N = int(input())
P = 1
D = 10**9 + 7

for n in range(1, N+1):
    P = (P * n) % D

print(P%D)
f787b9f2d24212b6562d45d5e312cde91f7810f9
<mask token>

<mask token>
for n in range(1, N + 1):
    P = P * n % D
print(P % D)

N = int(input())
P = 1
D = 10 ** 9 + 7
for n in range(1, N + 1):
    P = P * n % D
print(P % D)

N = int(input())
P = 1
D = 10**9 + 7

for n in range(1, N+1):
    P = (P * n) % D

print(P%D)