import math

a=int(eval(input()))

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

n=int(eval(input()))

def a(x):

  if x==1:

    return 1

  else:

    d=1

    for i in range(x+1)[1:]:

      d *= i

      d %= 10**9+7

    return d

print((a(n)))
import math

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

n = int(eval(input()))


def a(x):
    if x == 1:
        return 1
    else:
        d = 1
        for i in range(x + 1)[1:]:
            d *= i
            d %= 10**9 + 7
        return d


print((a(n)))

-import math +n = int(eval(input())) -a = int(eval(input())) -print((math.factorial(a) % (10**9 + 7))) + +def a(x): +    if x == 1: +        return 1 +    else: +        d = 1 +        for i in range(x + 1)[1:]: +            d *= i +            d %= 10**9 + 7 +        return d + + +print((a(n)))