If you're taking the pill correctly, it's extremely unlikely you would get pregnant the day before your period. If your cycle is irregular and you were doing anything to make the pill less effective (such as taking anti-biotics), then you should speak to your doctor or read about emergency contraception.
No need to get alarmed, the percentage of pregnancies during period is very low, specially when it was before your period (not mid period or after, that's riskier). Plan B (or next day pill) has some undesirable side effects, don't take it unless you know for a fact that you are at risk of pregnancy.
This might sound strange, but I am confused: Did the period or the condom last five days? -maybe the sex?