It's less effective against strains you're already infected with, but not entirely ineffective against them. That's why widespread vaccination at an age before sexual maturity is suggested.
Keep in mind that HPV is not necessarily a permanent infection. HPV infections are commonly cleared, putting you at risk for reinfection, which the vaccine will help protect against. It will also help protect you from further infections by the covered strains.