N = int(eval(input()))

ans = 1

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

    ans = (ans * i) % (10**9 + 7)

print(ans)
def factorial(N):

    fact = 1

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

        fact = (fact * i) % (10**9 + 7)

    return fact





if __name__ == "__main__":

    N = int(eval(input()))

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

def factorial(N):
    fact = 1
    for i in range(2, N + 1):
        fact = (fact * i) % (10**9 + 7)
    return fact


if __name__ == "__main__":
    N = int(eval(input()))
    print((factorial(N)))

-N = int(eval(input())) -ans = 1 -for i in range(2, N + 1): -    ans = (ans * i) % (10**9 + 7) -print(ans) +def factorial(N): +    fact = 1 +    for i in range(2, N + 1): +        fact = (fact * i) % (10**9 + 7) +    return fact + + +if __name__ == "__main__": +    N = int(eval(input())) +    print((factorial(N)))