There are two numbers, $n$ and $p$, with prime $p$ and $n < p$. One is to calculate $n! \bmod p$.
Is there any chance of doing this without explicitly determining $n!$ ?
I already know that with $n = p - 1$ then $n! \bmod p = p - 1$. Also if $n = 0$ or $1$, then $n! \bmod p = 1$ (which wasn't hard to see).
The explicit calculations shouldn't be a problem for small $n$, but will become stressful for large $n$.