from functools import reduce



N = int(eval(input()))

div = pow(10, 9) + 7

print((reduce(lambda ans, n: ans * n % div, list(range(1, N + 1)))))
N = int(eval(input()))

div = 10 ** 9 + 7

ans = 1

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

    ans = ans * i % div



print(ans)
from functools import reduce

N = int(eval(input()))
div = pow(10, 9) + 7
print((reduce(lambda ans, n: ans * n % div, list(range(1, N + 1)))))

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

-from functools import reduce - -div = pow(10, 9) + 7 -print((reduce(lambda ans, n: ans * n % div, list(range(1, N + 1))))) +div = 10**9 + 7 +ans = 1 +for i in range(2, N + 1): +    ans = ans * i % div +print(ans)