N = eval(input())

res = 1

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

    res *= i

    res %= 10 ** 9 + 7

print(res)

from functools import reduce
N = eval(input())

print(reduce(lambda x, y: x * y % (10 ** 9 + 7),  list(range(1, N + 1))))

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

from functools import reduce

N = eval(input())
print(reduce(lambda x, y: x * y % (10**9 + 7), list(range(1, N + 1))))

+from functools import reduce + -res = 1 -for i in range(1, N + 1): -    res *= i -    res %= 10**9 + 7 -print(res) +print(reduce(lambda x, y: x * y % (10**9 + 7), list(range(1, N + 1))))