Pregnancy

I had sex with a condom but for some reason my boyfriends cum was on my area when we finished.. We checked the condom an it didn't break, I was really scared so a couple hours later we went an got plan b pill or whatever. Does anyone know if it works?