Prove that if $p\equiv 1 \pmod{4}$ is a prime number and $$x\equiv \pm \left(\frac{p-1}{2}\right)! \pmod{p}$$ then $x^2\equiv -1 \pmod{p}$
I think Wilson's theorem will come in handy here, used in some clever way, but I can't see it. I would be very grateful for any help.