Show that $1000000! \equiv 500001 \mod 1000003$

elementary-number-theorymodular arithmetic

I'm working in the following exercise:

Show that $1000000! \equiv 500001 \mod 1000003$

Trying to find a way to apply Wilson's theorem I'm trying the following:

\begin{align*}
1000002! &\equiv -1 \mod 1000003!\\
1000002\cdot1000001! &\equiv -1 \mod 1000003!\\
1000002\cdot1000001\cdot1000000! &\equiv -1 \mod 1000003!\\
(-1)\cdot1000001\cdot1000000! &\equiv -1 \mod 1000003!
\end{align*}

This is as close as I've been able to be to the exercise, I don't know what path to follow to reach that $ 500001 $, any hint or help will be greatly appreciated.

Best Answer

As you already noticed, $$2\cdot1000000!\equiv1000000!\cdot1000001\cdot1000002=1000002!\equiv-1\pmod{1000003}$$

Now, the inverse of 2 $\pmod{1000003}$ is $\frac{1000004}{2}=500002$. So, $$1000000!\equiv-1\cdot500002=-500002\equiv500001\pmod{1000003}$$