N = int(eval(input()))

p = 1

for i in range(N):

    p = p * (i + 1) % (1e9 + 7)

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

MOD = 10 ** 9 + 7

S = 1

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

    S = S * i % MOD

print((S % MOD))
N = int(eval(input()))
p = 1
for i in range(N):
    p = p * (i + 1) % (1e9 + 7)
print((int(p)))

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

-p = 1 -for i in range(N): -    p = p * (i + 1) % (1e9 + 7) -print((int(p))) +MOD = 10**9 + 7 +S = 1 +for i in range(1, N + 1): +    S = S * i % MOD +print((S % MOD))