N = int(eval(input()))



from math import factorial

div = int(1e9 + 7)

ans  = factorial(N) % div

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

div = 10**9 + 7

pw = 1

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

  pw = (pw * i) % div

print(pw)
N = int(eval(input()))
from math import factorial

div = int(1e9 + 7)
ans = factorial(N) % div
print(ans)

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

-N = int(eval(input())) -from math import factorial - -div = int(1e9 + 7) -ans = factorial(N) % div -print(ans) +n = int(eval(input())) +div = 10**9 + 7 +pw = 1 +for i in range(1, n + 1): +    pw = (pw * i) % div +print(pw)