n = int(eval(input()))

ans = 1

i = 1

while i < n+1:

	ans *= i

	i += 1

	ans %= 10 ** 9 +7

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

power=1 

i=1 

div_num = 10**9 + 7 

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

    power = (power*i) % div_num 

print(power)
n = int(eval(input()))
ans = 1
i = 1
while i < n + 1:
    ans *= i
    i += 1
    ans %= 10**9 + 7
print(ans)

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

-n = int(eval(input())) -ans = 1 +N = int(eval(input())) +power = 1 -while i < n + 1: -    ans *= i -    i += 1 -    ans %= 10**9 + 7 -print(ans) +div_num = 10**9 + 7 +for i in range(1, N + 1): +    power = (power * i) % div_num +print(power)