import math



N = int(eval(input()))



power = math.factorial(N)



print((power % (10 ** 9 + 7)))

import math



N = int(eval(input()))



power = 1

NUM = 10 ** 9 + 7



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

    power *= i 

    if power >= NUM :

        power %= NUM

print(power)

"""

power = math.factorial(N)



print(power % (10 ** 9 + 7))

"""

import math

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

import math

N = int(eval(input()))
power = 1
NUM = 10**9 + 7
for i in range(1, N + 1):
    power *= i
    if power >= NUM:
        power %= NUM
print(power)
"""
power = math.factorial(N)
print(power % (10 ** 9 + 7))
"""

+power = 1 +NUM = 10**9 + 7 +for i in range(1, N + 1): +    power *= i +    if power >= NUM: +        power %= NUM +print(power) +""" -print((power % (10**9 + 7))) +print(power % (10 ** 9 + 7)) +"""