Plan-B Question

Am I fine if I took the pill with in 24 hours of having unprotected sex? He did pull out before he cum inside of me but I just want to make sure I'm ok. Someone please help me!