By Wilson's theorem we know that if $n$ is a prime number then $(n-1)! \equiv n-1 \pmod n$
So, upon division by $n-1$ on both the sides we have $(n-2)! \equiv 1 \pmod n$
Edit 1: The teacher deducted marks in this proof and said that I've to consider the case for mod 2 separately. Also, her claim is verified by proof given here .