How do I formally express the solution of x! = x when I know that x = 1, 2 {x in NN}?

The solutions are quite obvious but I don't know how I can write them down.