If it is one of subject 1 or subject 2, you can continue to take the senior high school subject 3 before your grades expire.
If you pass the third grade of junior high school, you need to retake all three courses if you want to take the senior high school math exam.