Prove that $n$ is a prime number if and only if $(n−2)! \equiv 1 \pmod n$.
I proved the part where we suppose that the latter is true and prove that n is prime. However, I'm stuck on how to prove the latter is true assuming n is prime. I tried following the proof for Wilson's Theorem, but I'm not sure how to translate it into a proof for $(n-2)!$. Can anyone show me where to start?