import math



n = int(eval(input()))

ans = math.factorial(n) % (pow(10, 9) + 7)

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

ans = 1

mod = 10 ** 9 + 7

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

    ans = (ans * i % mod) % mod

print(ans)
import math

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

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

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