Need help in mod 1000000007
<p>I'm stuck in a problem in which I need to calculate something like:</p>

<p>((500!)/(20!x20!x20!x20!...)) mod 1000000007 </p>

<p>I understand how to calculate 500!%1000000007 but I am not sure on how to distribute that operator in division. </p>

<p>I am currently trying to write a code which cancels the denominators by its numerator by its factors. But I am not sure if it is a good approach to this.</p>

<p>I just need a mathematical way of solving these kind of problems(mod1000000007) as they are regularly encountered in programming competitions and would help me to prepare for Google Code Jam.</p>
