import math



N = int(eval(input()))

C = 10**9 + 7



print((math.factorial(N) % C))
N = int(eval(input()))

C = 10**9+7

ans = 1

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

    ans *= i

    ans %= C

print(ans)
import math

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

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

-import math - -print((math.factorial(N) % C)) +ans = 1 +for i in range(1, N + 1): +    ans *= i +    ans %= C +print(ans)