How could I limit user entry in a cell?

Example:

Only entries possible are:
P
PW
L
LM
LE
M
ME
E

But not able to enter:
PL
PM
PE

TIA