According to the American College of Obstetricians and Gynecologists (ACOG):
"If you are vaccinated before being exposed to the virus, the HPV vaccine is 97 percent effective in preventing cervical cancer and cell changes that could lead to cancer. Plus, it’s almost 100 percent effective in preventing external genital warts."
https://www.acog.org/womens-health/experts-and-stories/the-latest/what-i-tell-every-patient-about-the-hpv-vaccine