import sys

def input(): return sys.stdin.readline().strip()



def resolve():

    import math

    n=int(eval(input()))

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

resolve()
import sys

def input(): return sys.stdin.readline().strip()



def resolve():

    answer=1

    n=int(eval(input()))

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

        answer*=i

        answer%=10**9+7

    print(answer)

resolve()
import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    import math

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


resolve()

import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    answer = 1
    n = int(eval(input()))
    for i in range(1, n + 1):
        answer *= i
        answer %= 10**9 + 7
    print(answer)


resolve()

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