Can i take planB the day after sex?

We had sex yesterday in the morning and he didn't pull out on time. We couldn't make it to store yesterday until today. I'm freaking out!!! Will I still be ok to take it tonight? Im on the Pill but I missed a pill about 2 weeks ago.