m363a4q7 edit

 

But   and   are distinct primes, so for the above to be valid, the following two equations must hold:

  and  

Considering only the first of the two equations (the latter case is, for lack of a better term, symmetrical), we have:

  and  .

The former is obviously true. The latter is proven using Fermat's Little Theorem, QED