<s>[INST] Compute $5!25! \mod 31$ For an exercise, I was asked to compute $5!25! \mod 31$. I noticed that $5! = 120 \equiv -4 \equiv 27 \mod 31$. Therefore we have that 
$$5!25! \equiv 27 \cdot 25! \mod 31.$$
Because of the congruence of Wilson, I also know that $30! \equiv -1 \mod 31$. 
We have that $30! \equiv 30 \cdot 29 \cdot 28 \cdot 26 \cdot 27 \cdot 25! \equiv -1 \mod 31$, so I computed 
$$(30 \cdot 29 \cdot 28 \cdot 26) \equiv (-1 \cdot (-2) \cdot (-3) \cdot (-5)) \equiv 30 \equiv -1 \mod 31.$$ Hence we find that $-1 \cdot (27 \cdot 25!) \equiv -1 \mod 31$ and therefore $27 \cdot 25! \equiv 1 \mod 31$. This proves that $5!25! \equiv 1 \mod 31$. 
Is this correct?
 [/INST] $$5!25!\equiv\left(15!\right)^2\equiv1^2=1$$
</s>