We work in the field $\Bbb F_p$ with $p$ elements. (Same as $\Bbb Z/p$, for the given prime $p$, i suppose it is a prime.)
Then
$$
\begin{aligned}
-1 &= 1\cdot 2\cdot 3\cdot 4\cdot 5\cdot 6\cdot \ \dots\ \cdot (p-2)\cdot(p-1)
\\
&=1\color{red}{\cdot (-2)}\cdot 3\color{red}{\cdot (-4)}\cdot 5\color{red}{\cdot (-6)}\cdot \ \dots\ \cdot (p-2)\color{red}{\cdot(-(p-1))}
\color{blue}{\cdot(-1)^{(p-1)/2}}
\\
&=1\cdot 3\cdot 5\cdot \ \dots\ \cdot (p-2)
\color{red}{\cdot (-2)\cdot (-4)\cdot (-6)\cdot \ \dots\ \cdot(-(p-1))}
\color{blue}{\cdot(-1)^{(p-1)/2}}
\\
&=1\cdot 3\cdot 5\cdot \ \dots\ \cdot (p-2)
\color{red}{\cdot (p-2)\cdot (p-4)\cdot (p-6)\cdot \ \dots\ \cdot(p-(p-1))}
\color{blue}{\cdot(-1)^{(p-1)/2}}
\\
&=(1\cdot 3\cdot 5\cdot \ \dots\ \cdot (p-2))^2
\color{blue}{\cdot(-1)^{(p-1)/2}}
\ .
\end{aligned}
$$
This leads to the answer...