n = int(eval(input()))

p = 1



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

    p = p * i % 1000000007



print(p)
n = int(eval(input()))



def training(n):

    power = 1

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

        power = power * i % 1000000007

    return power



print((training(n)))
n = int(eval(input()))
p = 1
for i in range(1, n + 1):
    p = p * i % 1000000007
print(p)

n = int(eval(input()))


def training(n):
    power = 1
    for i in range(1, n + 1):
        power = power * i % 1000000007
    return power


print((training(n)))

-p = 1 -for i in range(1, n + 1): -    p = p * i % 1000000007 -print(p) + + +def training(n): +    power = 1 +    for i in range(1, n + 1): +        power = power * i % 1000000007 +    return power + + +print((training(n)))