n=eval(input())

n=int(n)

a=1

for i in range(n):

    a=a*(i+1)

    if a>=pow(10,9)+7:

        a=a%(pow(10,9)+7)

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

a=1

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

    a*=i

    a %= (10**9+7)

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

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

-n = eval(input()) -n = int(n) +n = int(eval(input())) -for i in range(n): -    a = a * (i + 1) -    if a >= pow(10, 9) + 7: -        a = a % (pow(10, 9) + 7) +for i in range(1, n + 1): +    a *= i +    a %= 10**9 + 7