n = int(eval(input()))



import math

print((int(math.factorial(n))%(10**9+7)))
n = int(eval(input()))



mod = 10 **9 +7

ans = 1

for i in range(1, n+1):

    ans *= i

    ans = ans % mod

print(ans) 
n = int(eval(input()))
import math

print((int(math.factorial(n)) % (10**9 + 7)))

n = int(eval(input()))
mod = 10**9 + 7
ans = 1
for i in range(1, n + 1):
    ans *= i
    ans = ans % mod
print(ans)

-import math - -print((int(math.factorial(n)) % (10**9 + 7))) +mod = 10**9 + 7 +ans = 1 +for i in range(1, n + 1): +    ans *= i +    ans = ans % mod +print(ans)