CodeEff/ECCO huggingface dataset:
# Original solution
#
# abc055 b
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10"""
        output = """3628800"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """100000"""
        output = """457992974"""
        self.assertIO(input, output)


def resolve():
    N = int(eval(input()))

    p = 1
    for i in range(1, N+1):
        p *= i

    print((p % (10**9+7)))


if __name__ == "__main__":
    # unittest.main()
    resolve()


# Optimized solution
#
# abc055 b
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3"""
        output = """6"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10"""
        output = """3628800"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """100000"""
        output = """457992974"""
        self.assertIO(input, output)


def resolve():
    N = int(eval(input()))

    ans = 1
    for i in range(1, N+1):
        ans *= i
        ans %= (10**9+7)

    print(ans)


if __name__ == "__main__":
    # unittest.main()
    resolve()
# Original solution
n = int(eval(input()))


def main(n):
    pre = 1
    for i in range(1, n):
        pre = pre * i
    return pre * n % (pow(10, 9) + 7)


ans = main(n)
print(ans)


# Optimized solution
n = int(eval(input()))


mod_num = pow(10, 9) + 7


def main(n):
    pre = 1
    for i in range(2, n + 1):
        pre = pre * i % mod_num
    return pre


ans = main(n)
print(ans)
# Original solution
n = int(eval(input()))


mod_num = pow(10, 9) + 7


def main(n):
    pre = 1
    for i in range(2, n + 1):
        pre = pre * i % mod_num
    return pre


ans = main(n)
print(ans)


# Optimized solution
n = int(eval(input()))


mod_num = pow(10, 9) + 7


def main(n):
    ret = 1
    for i in range(1, n + 1):
        ret = ret * i % mod_num
    return ret
    

answer = main(n)
print(answer)
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
  ans *= i
print((ans%(10**9+7)))

# Optimized solution
n = int(eval(input()))
ans = 1
dummy1,dummy2 = divmod(n,2)
for i in range(1,dummy1+1):
  ans *= i
  ans *= n+1-i
  ans = ans % (10**9+7)
if dummy2 == 1:
  ans = ((dummy1+1)*ans % (10**9+7))
print(ans)
# Original solution
N = -1

def _input():
    global N
    N = int(eval(input()))

def solve():
    _input()
    snuke_power = 1
    for i in range(1, N+1):
        snuke_power *= i
    print((snuke_power % (10 ** 9 + 7)))


if __name__ == '__main__':
    solve()

# Optimized solution
N = -1

def _input():
    global N
    N = int(eval(input()))

def solve():
    _input()
    snuke_power = 1
    for i in range(1, N+1):
        snuke_power *= i
        snuke_power %= (10 ** 9 + 7)
    print(snuke_power)


if __name__ == '__main__':
    solve()
# Original solution
n = int(eval(input()))

p = 1

for i in range(1, n+1):
    p *= i
print((p%(10**9+7)))

# Optimized solution
n = int(eval(input()))

p = 1

for i in range(1, n+1):
    p = p*i%(10**9+7)
print(p)
# Original solution
import math

N = int(eval(input()))
ans = 0

ans =math.factorial(N) % (10**9 +7)

print(ans)

# Optimized solution
N = int(eval(input()))
power = 1

for i in range(N):
    power = ((i+1) * power) % 1000000007

print(power)
# Original solution
import math
N = int(eval(input()))
print((math.factorial(N)%(10**9+7)))

# Optimized solution
import math
N = int(eval(input()))
a = 1
for n in range(2,N+1):
    a = a*n % (10**9+7)
print(a)
# Original solution
N = int(eval(input()))
a = 1
for n in range(2,N+1):
    a = a*n % (10**9+7)
print(a)

# Optimized solution
def factorial(N):
    a = 1
    for n in range(2,N+1):
        a = a*n % (10**9 + 7)
    return a

if __name__ == '__main__':
    N = int(eval(input()))
    print((factorial(N)))
# Original solution
N = int(eval(input()))
power_r = 1
for n in range(2,N+1):
    power_r *= n
    power_r %= 10**9+7
print(power_r)

# Optimized solution
def factorial(N):
    power_r = 1
    for n in range(2,N+1):
        power_r *= n
        power_r %= 10**9+7
    return power_r

if __name__ == '__main__':
    N = int(eval(input()))
    print((factorial(N)))
# Original solution
def factorial(N):
    power_r = 1
    for n in range(2,N+1):
        power_r *= n
        power_r %= 10**9+7
    return power_r

if __name__ == '__main__':
    N = int(eval(input()))
    print((factorial(N)))

# Optimized solution
def factorial(N):
    power_r = 1
    for n in range(2,N+1):
        power_r = power_r*n % (10**9+7)
    return power_r

if __name__ == '__main__':
    N = int(eval(input()))
    print((factorial(N)))
# Original solution
#055 B
import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)

N = int(eval(input()))
lists = []
for i in range(1,N+1):
    lists.append(i)
ans = prod(lists)
print((ans%((10**9)+7)))

# Optimized solution
#055 B
N=int(eval(input()))
ans = 1
w = (10**9) +7
for i in range(1,N+1):
    ans *=i
    if ans >=w:
        ans %= w
print(ans)
# Original solution
h1 = int(eval(input()))
m = 1
for i in range(h1):
    m = m * (i + 1)
print((m % (10 ** 9 + 7)))


# Optimized solution
h1 = int(eval(input()))
m = 1
for i in range(h1):
    m = (m * (i + 1)) % (10 ** 9 + 7)
print(m)
# Original solution
N = int(eval(input()))
def kaijo(N) :
    ans = 1
    for i in range(1,N+1) :
        ans *=i
    return ans
mod = 1000000007
A = kaijo(N)
print((A%mod))

# Optimized solution
import math
print((math.factorial(int(eval(input())))%int(1e9+7)))
# Original solution
N = int(eval(input()))
power = 1
for i in range(1, N + 1):
    power *= i

print((power % (10 ** 9 + 7)))


# Optimized solution
N = int(eval(input()))
power = 1
for i in range(1, N + 1):
    power = (i*power)%(10**9+7)

print(power)
# Original solution
N = int(eval(input()))
v = 1
for i in range(1, N + 1):
    v *= i
print((v % (pow(10,9) + 7)))

# Optimized solution
N = int(eval(input()))
v = 1
for i in range(1, N + 1):
    v *= i
    v = v % (pow(10,9) + 7)
print(v)
# Original solution
N = int(eval(input()))
ans = 1
dev = 1000000007
for i in range(1, N+1):
  ans*=i
print((ans % dev))


# Optimized solution
N = int(eval(input()))
ans = 1
dev = 1000000007
for i in range(1, N+1):
  ans = i * ans % dev
print(ans)
# Original solution
# ABC 055 B

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

# Optimized solution
# ABC 055 B

N = int(eval(input()))
p = 1
for i in range(1, N+1):
    p = p * i % 1000000007
print(p)
# Original solution
N = int(eval(input()))

power = 1
for i in range(1, N + 1):
    power *= i
print((power % (10**9 + 7)))


# Optimized solution
import math
N = int(eval(input()))

print((math.factorial(N) % (10 ** 9 + 7)))
# Original solution
N = int(eval(input()))
power = 1

for i in range(N):
    power *= (i+1)
print((power % (10**9+7)))

# Optimized solution
import math
N = int(eval(input()))
power = math.factorial(N)
print((power % (10**9+7)))
# Original solution
n = int(eval(input()))
power = 1
for i in range(1, n+1):
    power *= i
print((power % 1000000007))


# Optimized solution
n = int(eval(input()))
power = 1
for i in range(1, n+1):
    power = (i * power) % 1000000007
print(power)
# Original solution
n = int(eval(input()))
p = 1
for i in range(n):
    p *= (i + 1)
print((p % (10**9 + 7)))


# Optimized solution
n = int(eval(input()))
p = 1
for i in range(n):
    p = p * (i + 1) % (10**9 + 7)
print(p)
# Original solution
n = int(eval(input()))
ans = 1
for i in range(n):
    ans = ans * (i+1)
print(("{}".format(ans % (10**9+7))))

# Optimized solution
n = int(eval(input()))

ans = 1
for i in range(n):
    ans = ans * (i+1) % (10**9+7)
print(("{}".format(ans)))
# Original solution
n = int(eval(input()))
p = 1
for i in range(1, n+1):
    p *= i

print((p%1000000007))

# Optimized solution
n = int(eval(input()))
p = 1
for i in range(1, n+1):
    p = (p%1000000007) * (i%100000007)

print((p%1000000007))
# Original solution
N = int(eval(input()))

double = 1

for i in range(1, N+1):
  double = double*i
  
print((double%(10**9+7)))


# Optimized solution
N = int(eval(input()))
 
double = 1
a = 10**9+7
 
for i in range(1, N+1):
  double *= i
  double %= a
  
print(double)
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
    ans *= i
ans = ans % (10 ** 9 + 7)
print(ans)

# Optimized solution
import math
n = int(eval(input()))
ans = math.factorial(n) % (10 ** 9 + 7)
print(ans)
# Original solution
N = int(eval(input()))
power = 1

for i in range(1, N+1):
    power *= i
    
amari = power % (10**9 + 7)

print(amari)

# Optimized solution
N = int(eval(input()))
power = 1

for i in range(1, N+1):
    power *= i
    power = power % (10**9 + 7)

print(power)
# Original solution
N = int(eval(input()))
result = 1
for i in range(1,N+1):
  result *= i
print((result%(10**9+7)))

# Optimized solution
N = int(eval(input()))
result =1
for i in range(1,N+1):
  result *= i
  result %= (10**9+7)
print(result)
# Original solution
N = int(eval(input()))
power = 1
BIGNUM = 10**9+7
for i in range(1,N+1):
    power *= i

ans = power%BIGNUM
print(ans)

# Optimized solution
N = int(eval(input()))
power = 1
BIGNUM = 10**9+7
for i in range(1,N+1):
    power *= i
    power = power%BIGNUM

ans = power
print(ans)
# Original solution
n = int(eval(input()))
p = 1
for i in range(0,n):
	p = p * (i+1)
print((p % (10**9 + 7)))

# Optimized solution
n = int(eval(input()))
p = 1
for i in range(1,n+1):
	p = (p * i) % (10**9 + 7)
print(p)
# Original solution
def cal(n):
	ans = 1
	for i in range(1,n+1):
		ans *= i
	rm = ans%(10**9 + 7)
	return rm

N = int(input().strip())
print((cal(N)))


# Optimized solution
def cal(n):
	ans = 1
	for i in range(n):
		ans = ((i+1) * ans) % (1000000007)
	return ans

N = int(eval(input()))
print((cal(N)))
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
  ans = ans * i
print((ans%(10**9+7)))

# Optimized solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
  ans = (ans * i)%(10**9+7)
print(ans)
# Original solution
# -*- coding: utf-8 -*-

N = int(eval(input()))

power = 1

for x in range(1, N + 1):
    power *= x

mod = 10 ** 9
mod += 7

answer = power % mod
print(answer)


# Optimized solution
# -*- coding: utf-8 -*-

import math

N = int(eval(input()))

power = 1

mod = 10 ** 9
mod += 7

power = math.factorial(N)

print((power % mod))
# Original solution
n = int(input())


N = []
for i in range(1,n+1):
	N.append(i)

N2 = 1
for N1 in N:
	N2 = N2 * N1

a = 10**9+7
N2 = N2%a

print(N2)



# Optimized solution
n = int(input())


N = []
for i in range(1,n+1):
	N.append(i)

N2 = 1
for N1 in N:
	N2 = N2 * N1%(10**9+7)

print(N2)
# Original solution
n = int(eval(input()))
mod = 10**9+7
ans = 1
i = 1
while i <= n:
    ans *= i
    i += 1
print((ans%mod))

# Optimized solution
n = int(eval(input()))
mod = 10**9+7
ans = 1
for i in range(1, n+1):
    ans = (ans*i)%mod
print(ans)
# Original solution
n = int(eval(input()))
power = 1

for i in range(1,n+1):
    power *= i
print((power%(10**9+7)))

# Optimized solution
n = int(eval(input()))
power = 1

for i in range(1,n+1):
    power *= i
    power %= 10**9+7

print(power)
# Original solution
n = int(eval(input()))
p = 1
for i in range(1, n+1):
  p *= i
print((p%(10**9+7)))

# Optimized solution
import math
n = int(eval(input()))
print((math.factorial(n)%(10**9+7)))
# Original solution
# coding: utf-8

if __name__ == '__main__':
    n = int(eval(input()))
    p = 1
    for i in range(n):  #range(10) は [0,1,2,3,4,5,6,7,8,9] を表す
        p = p * (i+1)
    print((p % int(1e9 + 7)))


# Optimized solution
# coding: utf-8

if __name__ == '__main__':
    n = int(eval(input()))
    p = 1
    for i in range(n):  #range(10) は [0,1,2,3,4,5,6,7,8,9] を表す
        p *= (i+1)
        p %= int(1e9 + 7)
    print(p)
# Original solution
n = int(eval(input()))

ans_tmp = 1
for i in range(1, n + 1):
    ans_tmp *= i

print((ans_tmp % (10 ** 9 + 7)))


# Optimized solution
n = int(eval(input()))

d = 10 ** 9 + 7
ans = 1
for i in range(1, n + 1):
    ans = ans * i % d

print(ans)
# Original solution
N = int(eval(input()))
power = 1
for num in range(1, N+1):
    power = power*num

print((power%(10**9+7)))

# Optimized solution
N = int(eval(input()))
power = 1

for i in range(1, N+1):
    power = (power*i)%(10**9+7)
print(power)
# Original solution
n = int(eval(input()))
t = 1
for i in range(1,n+1):
    t *= i
print((t%((10**9)+7)))

# Optimized solution
n = int(eval(input()))
t = 1
a = 10**9 + 7
for i in range(1,n+1):
    t *= i
    t %= a
print(t)
# Original solution
N = int(eval(input()))
power=1

for i in range(1,N+1):
    power=power*i
print((power%(pow(10,9)+7)))


# Optimized solution
N = int(eval(input()))
x=1
for i in range(1,N+1):
    x=i*x%(pow(10,9)+7)
print(x)
# Original solution
n=int(eval(input()))
p=1
for i in range(1,n+1):
    p*=i
print((p%(10**9+7)))

# Optimized solution
n=int(eval(input()))
p=1
for i in range(1,n+1):
    p=(p*i)%(10**9+7)
print(p)
# Original solution
n = int(eval(input()))
a = 1
for i in range(1,n+1):
    a = a*i
print((a%(10**9+7)))

# Optimized solution
import math
n = int(eval(input()))
a = math.factorial(n)
print((a%(10**9+7)))
# Original solution
m = 1
for var in range(int(input())):
  m = m * (var + 1)
print((m%(1000000000+7)))

# Optimized solution
multi = 1
N = int(input())
for var in range(1,N + 1):
  multi = multi * var
  if multi > 1000000007:
    multi = multi % 1000000007
print(multi)
# Original solution
N = int(eval(input()))
P = 1
for i in range(1, N+1):
    P *= i
_, ans = divmod(P, 1000000007)
print(ans)

# Optimized solution
N = int(eval(input()))
ans = 1
for i in range(1, N+1):
    _, ans = divmod(ans * i, 1000000007)
print(ans)
# Original solution
N=int(eval(input()))
ans=1
for i in range(1,N+1):
	ans*=i

print((ans%(10**9+7)))

# Optimized solution
import math
N=int(eval(input()))
ans=math.factorial(N)%(10**9+7)
print(ans)
# Original solution
N=int(eval(input()))
power=1
for i in range(N):
    power = (power*(i+1))%(10**9+7)
print(power)

# Optimized solution
def n_func(n,mod=10**9+7):
    ans=1
    for i in range(1,n+1):
        ans=(ans*i)%mod
    return ans
print((n_func(int(eval(input())))))
# Original solution
n = int(eval(input()))
m = 10**9+7

ans = 1
for i in range(2,n+1):
    ans*=i
print((ans%m))

# Optimized solution
n = int(eval(input()))
m = 10**9+7

ans = 1
for i in range(2,n+1):
    ans = ans*i%m
print((ans%m))
# Original solution
def countPower():
    power = 1
    N = int(eval(input()))
    i = 1
    if 1<=N<=10**5:
        while i <= N:
            power = i*power
            i += 1
    return power % (10**9 + 7)


if __name__=="__main__":
    print((countPower()))


# Optimized solution
import math

def countPower():
    power = 1
    N = int(eval(input()))
    if 1<=N<=10**5:
        power = math.factorial(N)
    return power % (10**9 + 7)

if __name__=="__main__":
    print((countPower()))
# Original solution
a = int(eval(input()))
b = 1
for i in range(1, a + 1):
    b = b * i % (10 ** 9 + 7)
print(b)


# Optimized solution
a = int(eval(input()))
b = 1
for i in range(1, a + 1):
    b = (b * i) % (10 ** 9 + 7)
print(b)
# Original solution
N = int(eval(input()))
pwr = 1
for i in range(1, N+1):
    pwr *= i
print((pwr % 1000000007))

# Optimized solution
N = int(eval(input()))
pwr = 1
for i in range(1, N+1):
    pwr *= i
    pwr = pwr % 1000000007
print(pwr)
# Original solution
# 整数の入力
N = int(eval(input()))
# 計算1
p = 1
 
for num in range(1,N+1):
    p = p * num
    
# 計算2
temp = 10**9 + 7
ans = p % temp
 
# 出力
print(ans)

# Optimized solution
# 整数の入力
N = int(eval(input()))
# 計算1
p = 1
temp = 10**9 + 7
 
for num in range(1,N+1):
    p = p * num
    if p > (10**9 + 7):
        p = p % temp
    
# 計算2
ans = p % temp
 
# 出力
print(ans)
# Original solution
from operator import mul
from functools import reduce
print(reduce(mul,list(range(1,int(eval(input()))+1)),1)%(10**9+7))

# Optimized solution
from operator import mul
from functools import reduce
print(reduce(lambda a,b:a*b%(10**9+7),list(range(1,int(eval(input()))+1)),1))
# Original solution
n = int(eval(input()))
pwr = 1
for i in range(n): 
    pwr *= 1*(i+1)
print((pwr%(10**9+7)))

# Optimized solution
n = int(eval(input()))
pwr = 1
for i in range(n): 
    pwr *= 1*(i+1)
    pwr = pwr%(10**9+7)
print(pwr)
# Original solution
n=int(eval(input()))
for i in range(1,n):
    n=n*i
print((n%(pow(10,9)+7)))

# Optimized solution
n=int(eval(input()))
p=1
for i in range(1,n+1):
    p=p%(pow(10,9)+7)*i
print((p%(pow(10,9)+7)))
# Original solution
N=int(eval(input()))
ans=1
for i in range(N):
    ans=ans*(i+1)
print((ans%(10**9+7)))


# Optimized solution
N=int(eval(input()))
ans=1
for i in range(N):
    ans=ans*(i+1)%(10**9+7)
print((ans%(10**9+7)))
# Original solution
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    p = 1
    for i in range(1,N+1):
        p *= i
    print((p % MOD))

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    p = 1
    for i in range(1,N+1):
        p = p * i % MOD
    print(p)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
    ans *= i
print((ans%(10**9+7)))


# Optimized solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
    ans = ans*i % (10**9+7)
print(ans)
# Original solution
N = int(eval(input()))

power = 1

for i in range(1,N+1):
	power *= i
	
print((power%(1000000007)))

# Optimized solution
N = int(eval(input()))

power = 1

for i in range(1,N+1):
	power *= i
	power %= 1000000007
	
print(power)
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
    ans *= i
print((ans%(10**9+7)))

# Optimized solution
import math
print((math.factorial(int(eval(input())))%(10**9+7)))
# Original solution
N=int(eval(input()))
A=1
for i in range(N):
  A *= (i+1)
 
# A = (1+N)/2 * N
# print(A)
A %=(10**9+7)
print(('%d' %(A)))


# Optimized solution
import math
 
N=int(eval(input()))
 
A = math.factorial(N)
A %=(10**9+7)

print(A)
# Original solution
N=int(eval(input()))
Ans=1
for i in range(1,N+1):
  Ans*=(i%(10**9+7))
print((Ans%(10**9+7)))

# Optimized solution
N=int(eval(input()))
Ans=1
for i in range(1,N+1):
  Ans*=i
  Ans%=(10**9+7)

print(Ans)
# Original solution
n = int(eval(input()))

p = 1
for i in range(n):
  p *= (i + 1)

print((p % 1000000007))

# Optimized solution
n = int(eval(input()))

mod = 1000000007

p = 1
for i in range(n):
  p = p * (i + 1) % mod

print((p % mod))
# Original solution
N = int(eval(input()))
ans = 1
for i in range(N):
    ans *= (i + 1)
print((ans % (10 ** 9 + 7)))


# Optimized solution
N = int(eval(input()))
ans = 1
for i in range(1, N + 1):
    ans = (i * ans) % (10 ** 9 + 7)
print(ans)
# Original solution
n = int(eval(input()))
j=1
for i in range(n,0,-1):
  j*=i
print((j if j <= 10**5 else j%((10**9)+7)))

# Optimized solution
import math
n = int(eval(input()))
j=math.factorial(n)
print((j if j <= 10**5 else j%((10**9)+7)))
# Original solution
N=int(eval(input()))
key=1
for i in range(1,N+1):
  key*=i
print((key%1000000007))

# Optimized solution
N=int(eval(input()))
key=1
for i in range(1,N+1):
  key=(key*i)%1000000007
print(key)
# Original solution
# coding: utf-8
N = int(eval(input()))
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans *= i
print((ans % mod))

# Optimized solution
# coding: utf-8
N = int(eval(input()))
mod = 10**9 + 7
ans = 1
for i in range(1, N+1):
    ans = ans * i % mod
print(ans)
# Original solution
import math
N = int(eval(input()))
print((math.factorial(N)%(10**9+7)))

# Optimized solution
ans=1
n=int(eval(input()))
for i in range(1,n+1):
    ans*=i
    ans=ans%(10**9+7)
print(ans)
# Original solution
n = int(eval(input()))
a = 1
for i in range(1, n + 1):
    a *= i
print((a % 1000000007))

# Optimized solution
n = int(eval(input()))
a = 1
for i in range(1, n + 1):
    a = (a * i) % (10 ** 9 + 7)
print(a)
# Original solution
n = int(eval(input()))

pw = 1
num = 1
for i in range(n):
  pw = pw  * num
  num += 1
  
print((pw % (10**9+7)))

# Optimized solution
n = int(eval(input()))

pw = 1
num = 1
for i in range(n):
  pw = pw*num % (10**9+7)
  num += 1
  
print(pw)
# Original solution
n = int(eval(input()))

p = 1
for i in range(1, n+1):
  p *= i
print((p % (10**9 + 7)))

# Optimized solution
import math
n = int(eval(input()))

p = math.factorial(n)
print((p % (10**9 + 7)))
# Original solution
n=int(eval(input()))
res=0
ans=1
while res<n:
  res+=1
  ans*=res
  
print((ans%(10**9+7)))

# Optimized solution
import math
n=int(eval(input()))
print((math.factorial(n)%(10**9+7)))
# Original solution
n = int(eval(input()))

ans = 1

for i in range(1, n+1):
    ans *= i
ans %= 1000000007

print(ans)

# Optimized solution
n = int(eval(input()))

ans = 1

for i in range(1, n+1):
    ans *= i
    ans %= 1000000007

print(ans)
# Original solution
n = int(eval(input()))

ans = 1
while(n>0):
    ans*=n
    n -= 1

print((ans%(1000000000+7)))

# Optimized solution
n = int(eval(input()))

ans = 1
while(n>0):
    ans*=n
    ans = ans%(1000000000+7)
    n -= 1

print(ans)
# Original solution
n=int(eval(input()))
s=1
for i in range(1,n+1):
    s*=i
ans=s%(10**9+7)
print(ans)

# Optimized solution
import math
n=int(eval(input()))
s=math.factorial(n)
ans=s%(10**9+7)
print(ans)
# Original solution
N = int(eval(input()))

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
power %= mod
print(power)


# Optimized solution
N = int(eval(input()))

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power = (i * power) % mod
print(power)
# Original solution
# -*- coding: utf-8 -*-

N = int(eval(input()))

ans = 1
for i in range(N):
    ans = ans * (i + 1)

# 大き過ぎる値を調整する
ans = ans % (10 ** 9 + 7) 

print(ans)

# Optimized solution
# -*- coding: utf-8 -*-

N = int(eval(input()))

ans = 1
for i in range(N):
    # 調整の処理は都度行っても端数の側に影響を与えないので問題ない
    ans = (ans * (i + 1)) % (10 ** 9 + 7) 

# 大き過ぎる値を調整する
# ans = ans % (10 ** 9 + 7) 

print(ans)
# Original solution
N = int(eval(input()))

power = 1
for i in range(1, N+1):
  power *= i

print((power % (10 ** 9 + 7)))


# Optimized solution
N = int(eval(input()))

power = 1
for i in range(1, N+1):
  power = power * i % (10 ** 9 + 7)

print(power)
# Original solution
n = int(eval(input()))

power = 1

p = 1000000000 + 7

for i in range(n):
    power *= (i + 1)

print((power % p))


# Optimized solution
n = int(eval(input()))

power = 1

p = 1000000000 + 7

for i in range(n):
    power = power * (i + 1) % p

print(power)
# Original solution
N = int(eval(input()))

ans = 1
for i in range(1, N+1):
    ans *= i
print((ans % (10 ** 9 + 7)))


# Optimized solution
N = int(eval(input()))

ans = 1
for i in range(1, N+1):
    ans = i * ans % (10 ** 9 + 7)
print(ans)