from math import factorial

def myAnswer(N:int) ->int:

   ans =factorial(N)

   return ans % (10**9 + 7)



def modelAnswer():

   tmp=1

def main():

   N = int(eval(input()))

   print((myAnswer(N)))





if __name__ == '__main__':

   main()
def modelAnswer(N:int) -> int:

   ans = 1

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

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

   return ans 

def main():

   N = int(eval(input()))

   print((modelAnswer(N)))





if __name__ == '__main__':

   main()

from math import factorial


def myAnswer(N: int) -> int:
    ans = factorial(N)
    return ans % (10**9 + 7)


def modelAnswer():
    tmp = 1


def main():
    N = int(eval(input()))
    print((myAnswer(N)))


if __name__ == "__main__":
    main()

def modelAnswer(N: int) -> int:
    ans = 1
    for i in range(1, N + 1):
        ans = (ans * i) % (10**9 + 7)
    return ans


def main():
    N = int(eval(input()))
    print((modelAnswer(N)))


if __name__ == "__main__":
    main()

-from math import factorial - - -def myAnswer(N: int) -> int: -    ans = factorial(N) -    return ans % (10**9 + 7) - - -def modelAnswer(): -    tmp = 1 +def modelAnswer(N: int) -> int: +    ans = 1 +    for i in range(1, N + 1): +        ans = (ans * i) % (10**9 + 7) +    return ans -    print((myAnswer(N))) +    print((modelAnswer(N)))