Equality of Cartesian Products

Theorem
Let $A,B,C,D$ be nonempty sets.

Then $A \times B = C \times D \iff A = C \land B = D$, where $\times$ denotes cartesian product.