But he could get out after only a few months behind bars.
Yarnall also must give up his teacher's license and can never hold a public job in New Jersey.
Police say they found Yarnall in a vehicle with the 17-year-old student in a dark area. Investigators say the two had been having sex for nearly a year, starting when she was 16.