Plan b

If I took plan b pill 1 day before I was supposed to ovulate, would it still work? If the egg had not released yet? Or will it only likely fail if the egg has already been released ?