n = int(eval(input()))



INF = 10**9 + 7



ans = [0] * (10**5 + 1)

ans[0] = 1



for i in range(1,10**5 + 1):

    ans[i] = ans[i-1] * i % INF



print((ans[n]))

n = int(eval(input()))

mod = 10**9 + 7



ans = 1



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

    ans = ans * i % mod



print(ans)
n = int(eval(input()))
INF = 10**9 + 7
ans = [0] * (10**5 + 1)
ans[0] = 1
for i in range(1, 10**5 + 1):
    ans[i] = ans[i - 1] * i % INF
print((ans[n]))

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

-INF = 10**9 + 7 -ans = [0] * (10**5 + 1) -ans[0] = 1 -for i in range(1, 10**5 + 1): -    ans[i] = ans[i - 1] * i % INF -print((ans[n])) +mod = 10**9 + 7 +ans = 1 +for i in range(1, n + 1): +    ans = ans * i % mod +print(ans)