from math import factorial

print((factorial(int(eval(input()))) % (10**9+7)))
ans = 1

for k in range(1, int(eval(input()))+1):

    ans = ans*k % (10**9+7)

print(ans)
from math import factorial

print((factorial(int(eval(input()))) % (10**9 + 7)))

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

-from math import factorial - -print((factorial(int(eval(input()))) % (10**9 + 7))) +ans = 1 +for k in range(1, int(eval(input())) + 1): +    ans = ans * k % (10**9 + 7) +print(ans)