Raba said: It is the duty of a man to mellow himself [with wine] on Purim until he cannot tell the difference between "cursed be Haman" and "blessed be Mordecai."(1)
When using gematria (a numerical value given to each letter) the two phases have the same numerical value, 502.
1). The Soncino Talmud Mas. Megilah 7b.