I came across the two congruences that for $p$ an odd prime,
$$1^2\cdot 3^2\cdot 5^2\cdots (p-2)^2\equiv (-1)^{(p+1)/(2)}\pmod p$$
and
$$2^2\cdot 4^2\cdot 6^2\cdots (p-1)^2\equiv (-1)^{(p+1)/(2)}\pmod p$$
What is the reason for this? It seems to me to be closely related to Wilson's Theorem, and possibly Fermat's little theorem since $p-1=2k$ for some $k$, and then $j^{2k}\equiv 1\pmod p$ for all the evens and odds $j$ less than $p$, but I wasn't able to complete this train of thought.