n = int(eval(input()))

p = 1

for i in range(n):

    p = (p * (i + 1)) % (10 ** 9 + 7)

print(p)

n = int(eval(input()))

p = 1

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

    p = (p * i) % (10 ** 9 + 7)

print(p)

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

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

-for i in range(n): -    p = (p * (i + 1)) % (10**9 + 7) +for i in range(1, n + 1): +    p = (p * i) % (10**9 + 7)