Does plan B work ?

last week or so my significant other & I had unprotected as always . He didn’t pull out on time , 20 minuets after I went to the store , got the plan b ate some cereal then took it , I’m afraid it might not work... mind you I get my period at the end of the month , this was my very first time taking it .