human
Write me a code to modulo 10 ^ 9 + 7 ( 1000000007 ) and the other steps required given the following:
Modulo 10 ^ 9 + 7 ( 1000000007 ) | .
f = f * i WRONG APPROACH as f may exceed ( 2 ^ 64 - 1 )"
How can the above be solved in Python?
assistant
#Here is code to modulo 10 ^ 9 + 7 ( 1000000007 ) and the other steps required.
 def factorial ( n ) :
	M = 1000000007
	f = 1
	for i in range ( 1 , n + 1 ) :
	return f % M