What is the remainder when 5!25! is divided by 31?
Or use Wilson’s theorem.
$\displaystyle 30!\equiv-1\pmod{31}$
$\displaystyle 30\times29\times28\times27\times26\equiv(-1)(-2)(-3)(-4)(-5)\pmod{31}\equiv-5!\pmod{31}$
$\displaystyle \therefore\ 5!25!\equiv-30!\pmod{31}\equiv1\pmod{31}$