
Order Modulo Factorial
Given a prime $p$ and a positive integer $n \lt p$, let $R(p, n)$ be the multiplicative order of $p$ modulo $n!$.
In other words, $R(p, n)$ is the minimal positive integer $r$ such that
For example, $R(7, 4) = 2$ and $R(10^9 + 7, 12) = 17280$.
Find $R(10^9 + 7, 10^7)$. Give your answer modulo $10^9 + 7$.
