You have been accepted, so it isn’t as if Yale is going to care much now about ECs and essays. The bigger concern is the grade.
Make an appointment to meet with your guidance counselor and your teacher ASAP. Ask the guidance counselor to contact Yale on your behalf. Maybe Yale will average the grade for the year, or maybe the GC can find a way for yiu to retake the course at a CC over the summer, or come up with some other plan. Ask the teacher what you can do to bring up the grade. Get a tutor, go to extra help, do everything possible to bring the grade up to a C. The time to act is now.