After relabeling we may assume n<m.
Step 1: We claim that there exists a natural number k such that m=kn.
Write the equation as
n^n n^(m-n) = m^n
n^(m-n) = (m/n)^n
The left-hand-side is always an integer. The right-hand-side is an integer if and only if such a factor k exists.
Step 2: Inserting this ansatz, we may take n-th roots and reduce the problem to n^k =k n.
Step 3: Monotonicity. Clearly we have equality for k=1. We claim that the difference n^k-kn strictly increases with k for fixed n unless n=2, k=1. That claim in particular gives the result.
We prove this by induction in k. That is, suppose that n^k\geq kn holds for all k\leq K, then
n^(K+1) = n n^K \geq n K n \geq Kn +Kn \geq Kn +n = (K+1)n.
The second inequality is strict unless n=2 and the last one is strict unless K=1.