n=int(eval(input()))

x=1

for i in range(n):

    x*=(i+1)

    if x>10**9+7:

        x=x%(10**9+7)



print(x)

#import numpy as np

#n=int(input())

#print(np.prod([i+1 for i in range(n)]))

#print(np.prod([i+1 for i in range(n)])%((10**9)+7))



#オーバーフロー？

power=1

n=int(eval(input()))

mod=10**9+7

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

    power*=i

    power%=mod

    #print(power)

print(power)

n = int(eval(input()))
x = 1
for i in range(n):
    x *= i + 1
    if x > 10**9 + 7:
        x = x % (10**9 + 7)
print(x)
# import numpy as np
# n=int(input())
# print(np.prod([i+1 for i in range(n)]))
# print(np.prod([i+1 for i in range(n)])%((10**9)+7))
# オーバーフロー？

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

+power = 1 -x = 1 -for i in range(n): -    x *= i + 1 -    if x > 10**9 + 7: -        x = x % (10**9 + 7) -print(x) -# import numpy as np -# n=int(input()) -# print(np.prod([i+1 for i in range(n)])) -# print(np.prod([i+1 for i in range(n)])%((10**9)+7)) -# オーバーフロー？ +mod = 10**9 + 7 +for i in range(1, n + 1): +    power *= i +    power %= mod +    # print(power) +print(power)