import math

n = int(eval(input()))

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

n = int(eval(input()))

mod = 10**9 + 7



pow = 1

for i in range(n):

    pow = pow*(i+1)%mod



print(pow)

import math

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

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

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