Morning after pill

I took the morning after pill 1 hour after unprotected sex, is that okay; will it work?