n = int(eval(input()))



from math import factorial



power = factorial(n)

mod = 10 ** 9 + 7

ans = power % mod

print(ans)

n = int(eval(input()))



mod = 10 ** 9 + 7

power = 1

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

    power = i * power % mod



print(power)

n = int(eval(input()))
from math import factorial

power = factorial(n)
mod = 10**9 + 7
ans = power % mod
print(ans)

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

-from math import factorial - -power = factorial(n) -ans = power % mod -print(ans) +power = 1 +for i in range(1, n + 1): +    power = i * power % mod +print(power)