Why is the square of all odds less than an odd prime $p$ congruent to $(-1)^{(p+1)/(2)}\pmod p$?
Solution 1:
Modulo $p$, you have $k=-(p-k)$ and so both products are equal to $(p-1)!(-1)^{(p-1)/2} \equiv (-1)^{(p+1)/2} \pmod{p}$ by Wilson's theorem.