I need to prove that if p is an odd prime and
$r = (p-1)/2$ then
$(r!)^2 ≡ (−1)^{r−1} \pmod p$
I think it has something to do with gauss's lemma
https://en.wikipedia.org/wiki/Gauss%27s_lemma_(number_theory)
but I tried a lot and couldn't find a way to break it .
any help or hint will be appreciated.