How do you prove set with modulo? Given any prime $p$. Prove that $(p-1)! \equiv -1 \pmod p$.
How to prove this?

This is known as Wilson's theorem: (not completely, but Wilson's theorem is an if and only if while this is only an if)
https://en.wikipedia.org/wiki/Wilson%27s_theorem
The idea is that (p-1)! is the product of an element of each residue class $\bmod p$, also since all numbers less than p are relatively prime to p each of them has a unique inverse.
except for p-1 and 1 each of them has an inverse different to itself, therefore the ones that aren't 1 or p-1 cancel out, and $1*(p-1)\equiv -1 \bmod p$ as desired.
Note: to prove that only 1 and -1 are inverses of themselves see that
$a\equiv a^{-1}\rightarrow a^2\equiv 1 \bmod p \rightarrow p|a^2-1\rightarrow p|(a+1)(a-1)\rightarrow p|a+1 $ or $ p|a-1\rightarrow a\equiv1$ or $a\equiv -1 \bmod p$
