from math import factorial



mod = 10**9 + 7

n = int(eval(input()))



ans = factorial(n) % mod

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

MOD = 10**9 + 7

ans = 1

for i in range(2, N+1):

    ans *= i

    ans %= MOD

print(ans)

from math import factorial

mod = 10**9 + 7
n = int(eval(input()))
ans = factorial(n) % mod
print(ans)

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

-from math import factorial - -mod = 10**9 + 7 -n = int(eval(input())) -ans = factorial(n) % mod +N = int(eval(input())) +MOD = 10**9 + 7 +ans = 1 +for i in range(2, N + 1): +    ans *= i +    ans %= MOD