import math



n = int(eval(input()))



print((math.factorial(n)%(10**(9) + 7)))
mod = 10**9+7

ans = 1

for i in range(int(eval(input()))):

    ans *= i+1

    ans %= mod

print(ans)
import math

n = int(eval(input()))
print((math.factorial(n) % (10 ** (9) + 7)))

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

-import math - -n = int(eval(input())) -print((math.factorial(n) % (10 ** (9) + 7))) +mod = 10**9 + 7 +ans = 1 +for i in range(int(eval(input()))): +    ans *= i + 1 +    ans %= mod +print(ans)