import sys



def dfs():

    return



def resolve():

    N = int(eval(input()))

    power = 1



    for i in range(N):

        power *= (i+1)

        power %= int((1e+9 + 7))



    print(power)





if __name__ == "__main__":

    resolve()

def resolve():

  n = int(eval(input()))

  ans = 1

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

    ans *= i

    ans %= 1000000007

  print(ans)

  return



if __name__ == "__main__":

  resolve()

import sys


def dfs():
    return


def resolve():
    N = int(eval(input()))
    power = 1
    for i in range(N):
        power *= i + 1
        power %= int((1e9 + 7))
    print(power)


if __name__ == "__main__":
    resolve()

def resolve():
    n = int(eval(input()))
    ans = 1
    for i in range(1, n + 1):
        ans *= i
        ans %= 1000000007
    print(ans)
    return


if __name__ == "__main__":
    resolve()

-import sys - - -def dfs(): +def resolve(): +    n = int(eval(input())) +    ans = 1 +    for i in range(1, n + 1): +        ans *= i +        ans %= 1000000007 +    print(ans) - - -def resolve(): -    N = int(eval(input())) -    power = 1 -    for i in range(N): -        power *= i + 1 -        power %= int((1e9 + 7)) -    print(power)