import math

n=int(eval(input()))

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

def fact(n):

    val=1

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

        val*=i

        val%=1000000007

    return val

print((fact(N)))
import math

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

N = int(eval(input()))


def fact(n):
    val = 1
    for i in range(2, n + 1):
        val *= i
        val %= 1000000007
    return val


print((fact(N)))

-import math +N = int(eval(input())) -n = int(eval(input())) -print((math.factorial(n) % (10**9 + 7))) + +def fact(n): +    val = 1 +    for i in range(2, n + 1): +        val *= i +        val %= 1000000007 +    return val + + +print((fact(N)))