#!/usr/bin/env pypy3



import math

print((math.factorial(int(eval(input()))) % 1000000007))
n = int(eval(input()))

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

	n *= i

	n %= 10**9 + 7

print(n)
#!/usr/bin/env pypy3
import math

print((math.factorial(int(eval(input()))) % 1000000007))

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

-#!/usr/bin/env pypy3 -import math - -print((math.factorial(int(eval(input()))) % 1000000007)) +n = int(eval(input())) +for i in range(n - 1, 1, -1): +    n *= i +    n %= 10**9 + 7 +print(n)