Plan B pill

I had unprotected sex 4 days ago. Would buying it from a pharmacy such as walgreens and taking the plan b pill still work?