Problem:
 Score : 200 points    Problem Statement Snuke loves working out. He is now exercising N times.  Before he starts exercising, his power is 1 . After he exercises for the i -th time, his power gets multiplied by i .  Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7 .      Constraints  1 ≤ N ≤ 10^{5}         Input The input is given from Standard Input in the following format:  N       Output Print the answer modulo 10^{9}+7 .        Sample Input 1 3      Sample Output 1 6   After Snuke exercises for the first time, his power gets multiplied by 1 and becomes 1 .  After Snuke exercises for the second time, his power gets multiplied by 2 and becomes 2 .  After Snuke exercises for the third time, his power gets multiplied by 3 and becomes 6 .        Sample Input 2 10      Sample Output 2 3628800       Sample Input 3 100000      Sample Output 3 457992974  Print the answer modulo 10^{9}+7 .

Solution (Python):


import math

def main():
    n = int(input())
    ans =math.factorial(n)
    print(ans%1000000007)

if __name__=="__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline


MOD = (10**9) + 7


def main():
    ans = 1
    N = int(input().strip())
    for n in range(1, N + 1):
        ans *= n
        ans = ans % MOD
    return ans


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

Solution (Python):
N = int(input())

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

Solution (Python):
import math
n = int(input())
print(math.factorial(n)%(10**9+7))

Solution (Python):
def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp

a=int(input())
print(factorial(a))

Solution (Python):
n = int(input())

power = 1

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

print(power)

Solution (Python):
import math

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

Solution (Python):
n = int(input())
p = 1
for i in range(1,n+1):
    p *= i
    if p >=(10**9+7):
        p%= (10**9+7)
print(p)

Solution (Python):
N = int(input())

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

Solution (Python):
N = int(input())
num = 1
for i in range(1, N+1):
    num *= i
    num = num % (1000000007)
print(num)

Solution (Python):
n = int(input())

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

Solution (Python):
import math

N = int(input())
print(math.factorial(N) % 1000000007)

Solution (Python):
N = int(input())
p = 1
for i in range(1,N+1):
    p = i * (p % ((10**9)+7))
print(p % ((10**9)+7))

Solution (Python):
N = int(input())
ans = 1

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

Solution (Python):

n = int(input())


def func(times):
    power = 1
    divide_num = 10 ** 9 + 7

    for i in range(times):
        power *= (i + 1)
        power %= divide_num

    print(power)


func(times=n)

Solution (Python):
n=int(input())
sum=1
for i in range(n):
  sum*=i+1
  if sum>10**9:
    sum=sum%(10**9+7)
  
print(sum)

Solution (Python):

N = int(input())
val = 1
for n in range(1,N+1):
    val = (val * n) % (10 ** 9 + 7)
print(val)

Solution (Python):
import math
n = int(input())
print(math.factorial(n) % (10**9 + 7))

Solution (Python):
import math
print(math.factorial(int(input()))%((10**9)+7))

Solution (Python):
n=int(input())
ans=1
for i in range(n):
    ans=(ans*(i+1))%(10**9+7)
print(ans)

Solution (Python):
N = int(input())
MOD = 10**9 + 7
p = 1
for i in range(1,N+1):
     p = ((p%MOD) * (i%MOD))%MOD
print(p)

Solution (Python):
N=int(input())
p=1
for i in range(1,N+1):
    p=p*i%(10**9+7)
print(p)

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())
ans = 1
for i in range(1, n + 1):
  ans = ans * i % 1000000007
print(ans)

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

Solution (Python):
n = int(input())

res = 1

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

print(res)

Solution (Python):
import math
n=int(input())
print(math.factorial(n)%(10**9+7))

Solution (Python):
mod = 10 ** 9 + 7
import math
n = int(input())
print(math.factorial(n) % mod)

Solution (Python):
mod = 10 ** 9 + 7
n = int(input())
ans = 1
for i in range(1, n + 1):
    ans *= i
    ans %= mod
print(ans)

Solution (Python):
def main():
    N = int(input())

    mod = 10**9+7

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a=int(input())
import math
x=math.factorial(a)
print(x%(10**9+7))

Solution (Python):

"""
Created on Sat May 30 11:26:40 2020

@author: naoki
"""

N = int(input()) 
power = 1 

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

Solution (Python):
MOD = 10**9 + 7
N = int(input())
power = 1
for i in range(1, N + 1):
    power = power * i % MOD
print(power)

Solution (Python):
MOD = 10 ** 9 + 7
N = int(input())
ans = 1
for i in range(1, N + 1):
    ans *= i
    ans %= MOD
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline









N = int(input())
mod = 10**9+7

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

print(ans)

Solution (Python):
n = int(input())
ans = 1
for i in range(n):
    ans = (ans * (i + 1)) % (10 ** 9 + 7)
print(ans)

Solution (Python):
N = int(input())
ans = 1
INF = 10 ** 9 + 7
for i in range(1, N + 1):
    ans = (i * ans) % INF
print(ans)

Solution (Python):
n = int(input())
result = 1
limit = 10**9+7
for i in range(1, n+1):
    result = result*i % limit
print(result)

Solution (Python):
MOD = 10**9 + 7
N = int(input())
c = 1
for i in range(1, N+1):
  c = c * i % MOD

print(c)

Solution (Python):
n= int(input())
cnt = 1
for i in range(1,n+1):
  cnt *= i
  cnt %= (10**9+7)
print(cnt)

Solution (Python):
i = int(input())
p = 1
M = 10 **9+7 
for ii in range(1,i+1):
	ii %= M
	p *= ii
	p %= M
print(p)

Solution (Python):
a = int(input())
import math
b = math.factorial(a)%(10**9+7)
print(b)

Solution (Python):
n=int(input())
MOD=10**9+7
ans=1
for i in range(1,n+1):
    i%=MOD
    ans*=i
    ans%=MOD
print(ans)

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
ans = 1
for i in range(1,N+1):
    ans *= i
    ans %= 10**9+7
print(ans)

Solution (Python):
import math
n = int(input())
a = math.factorial(n)
print(a%(10**9+7))

Solution (Python):
n = int(input())

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

print(training(n))

Solution (Python):
n = int(input())
p = 1

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

print(p)

Solution (Python):
n = int(input())
for i in range(n - 1, 1, -1):
	n *= i
	n %= 10**9 + 7
print(n)

Solution (Python):
N = int(input())

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

Solution (Python):
INF = 10**9 + 7

N = int(input())
power = 1

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

print(power)

Solution (Python):
MOD = 1000000007
N = int(input())
res = 1
for i in range(N):
    res *= i + 1
    res %= MOD
print(res)

Solution (Python):
INF = 10**9 + 7

N = int(input())
power = 1

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

print(power)

Solution (Python):
n = int(input())

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

Solution (Python):
import math
n = int(input())

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

Solution (Python):
import math

n = int(input())

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

Solution (Python):
p=1
N =int(input())
for i in range(1,N+1):
    p = p * i
    p %= (10**9+7)
print(p)

Solution (Python):
n = int(input())
mod = 10 ** 9 + 7

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

print(ans)

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    def make_factorial_table(size, mod):
        '''
        fact_mod[i] は i! % mod を表す。fact_mod[0] ~ facto_mod[size] まで計算可能なテーブルを返す
        >>> make_factorial_table(20, 10**9+7)
        [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 227020758, 178290591, 674358851, 789741546, 425606191, 660911389, 557316307, 146326063]
        '''
        fact_mod = [1] * (size + 1)
        for i in range(1, size + 1):
            fact_mod[i] = (fact_mod[i - 1] * i) % mod
        return fact_mod
    
    n = ii()
    fact = make_factorial_table(n, mod)
    print(fact[n])



if __name__ == "__main__":
    main()

Solution (Python):
import math
n = int(input())
print(math.factorial(n) % (10**9 + 7))

Solution (Python):
n = int(input())
mod = 10**9 + 7
p = 1
for i in range(1,n+1):
    p = p * i % mod

print(p)

Solution (Python):
N = int(input())
power = 1
for i in range(N):
    power*=i+1
    power%=1000000007
print(power)

Solution (Python):
import math
print(math.factorial(int(input()))%(10**9+7))

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

Solution (Python):
import math
N = int(input())
print(math.factorial(N) % (10 ** 9 + 7))

Solution (Python):
N = int(input())
ans = 1

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

Solution (Python):
import math
N = int(input())
print(math.factorial(N) % (10**9+7))

Solution (Python):
import math
N = int(input())
print(math.factorial(N)%(10**9+7))

Solution (Python):
n = int(input())
DIV=10**9+7
s=1
for i in range(1,n+1):
    s=(s*i)%int(DIV)
print(s)

Solution (Python):
import math
N = int(input())
print(math.factorial(N) % (10**9+7))

Solution (Python):
def resolve():
    n = int(input())
    division_num = 10 ** 9 + 7
    
    ans = 1
    mod = 0
    for i in range(1, n + 1):
        ans *= i
        if ans > division_num:
            ans %= division_num
    
    print(ans)

resolve()

Solution (Python):
p = 1
for i in range(1,int(input())+1):
    p = (p*i)%int(1e9+7)

print(p)

Solution (Python):
N = int(input())
R = 10 ** 9 + 7
power = 1

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

print(power)

Solution (Python):
N = int(input())

class Mint:
    
    MOD = 10**9+7
    
    def __init__(self, x=0):
        self.x = (x%self.MOD + self.MOD) % self.MOD
    
    def __iadd__(self, other):
        self.x += other.x
        if self.x >= self.MOD:
            self.x -= self.MOD
        return self
    
    def __isub__(self, other):
        self.x += self.MOD - other.x
        if (self.x >= self.MOD):
            self.x -= self.MOD
        return self
    
    def __imul__(self, other):
        self.x *= other.x
        self.x %= self.MOD;
        return self;
    
    def __add__(self, other):
        ans = Mint(self.x)
        ans += other
        return ans
        
    def __sub__(self, other):
        ans = Mint(self.x)
        ans -= other
        return ans
    
    def __mul__(self, other):
        ans = Mint(self.x)
        ans *= other
        return ans
    
    def __pow__(self, n):
        if n == 0:
            return Mint(1)
        a = self.__pow__(n >> 1)
        a *= a
        if n&1:
            a *= self
        return a
    
    def inv(self):
        return self**(self.MOD-2)
    
    def __ifloordiv__(self, other):
        self *= other.inv()
        return self
    
    def __floordiv__(self, other):
        ans = Mint(self.x)
        ans //= other
        return ans
        
        
def Main(N):
    ans = Mint(1)
    for i in range(1, N+1):
        ans *= Mint(i)
    return ans.x
    
print(Main(N))

Solution (Python):
n = int(input())
ans = 1
p = pow(10,9)+7
for i in range(2,n+1):
    ans = (i * ans)%p
print(ans)

Solution (Python):
import math
print(math.factorial(int(input()))%(10**9+7))

Solution (Python):
N = int(input())
import math
ans = math.factorial(N)
ans %= 1000000007
print(ans)

Solution (Python):
n = int(input())
p = 1
mod = 1000000007
for i in range(1, n + 1):
    p *= i
    p = p % mod
print(p)

Solution (Python):
n = int(input())

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

Solution (Python):
n = int(input())
INF = 10**9+7

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

Solution (Python):
import math

def main():
    n = int(input())
    mod = 10**9 + 7
    print(math.factorial(n)%mod)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
mod = 10**9 + 7

ans = 1

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

print(ans)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





N = inputI()

print(kaijo(N))

Solution (Python):


INF = 10**9 + 7
n = int(input())
result = 1

for x in range(1, n+1):
    result = result * x % INF

print(result)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    def COMinit(n,MOD):
        fac,finv,inv=[0]*max(2,n+1),[0]*max(2,n+1),[0]*max(2,n+1)
        fac[0]=fac[1]=1
        finv[0]=finv[1]=1
        inv[1]=1
        for i in range(2,(n+1)):
            fac[i]=fac[i-1]*i%MOD
            inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD
            finv[i]=finv[i-1]*inv[i]%MOD
        return fac,finv,inv
    
    fac,finv,inv=COMinit(N,MOD)
    
    def COM(n, k, MOD=MOD):
        if n<k or n<0 or k<0:
            return 0
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD
    
    print(fac[N])

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())

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

print(power)

Solution (Python):
ans = 1
for i in range(1,int(input())+1):
  ans *= i
  ans %= 10**9+7
print(ans)

Solution (Python):
n=int(input())
ans = 1
for i in range(2,n+1):
  ans = ans*i%(10**9+7)
print(ans%(10**9+7))

Solution (Python):
N = int(input())

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

Solution (Python):
n=int(input())


k=0
ans=1
w=10**9+7

for i in range(n):
  k = k+1
  ans*=k
  ans%=w

print(ans)

Solution (Python):
import math
N = int(input())
mod = 10**9+7
print(math.factorial(N)%mod)

Solution (Python):
import math

n = int(input())
print(math.factorial(n) % 1000000007)

Solution (Python):
import sys
import math
import itertools
MOD=10**9+7
n = int(input())
ans=1
for i in range(1, n + 1):
    ans =ans%MOD*i
print(ans%MOD)

Solution (Python):
n = int(input())
ans = 1

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

print(ans)

Solution (Python):
MOD = 10**9 + 7
N = int(input())
cnt = 1
for i in range(N):
    cnt *= (i+1)
    cnt = cnt%MOD
print(cnt)

Solution (Python):


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

Solution (Python):
wari = 10**9 + 7
n = int(input())
count = 1
for i in  range(1,n+1):
   count *= i
   count %= wari
print(count)

Solution (Python):
N = int(input())
r = 1

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

Solution (Python):
N = int(input())
m = 1
for i in range(2,N+1):
  m = m*i%(10**9+7)
print(m)

Solution (Python):
n = int(input())
power = 1

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

Solution (Python):
import math
a = int(input())
print(math.factorial(a)%(10**9+7))

Solution (Python):
N=int(input())
ans=1
for i in range(N): ans=(ans*(i+1))%(10**9+7)
print(ans)

Solution (Python):
n=int(input())
ans=1
for i in range(n):
  ans=ans*(i+1)%(10**9+7)
print(ans)

Solution (Python):
import math
print(math.factorial(int(input())) % (10 ** 9 + 7))

Solution (Python):
import math
N = int(input())
print(math.factorial(N) % (10**9+7))

Solution (Python):
N = int(input())

po = 1

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


print(po)

Solution (Python):



MOD = 10 ** 9 + 7

n = int(input())

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

print(ans)

Solution (Python):
n = int(input())
power = 1
mod = 10**9 + 7
for i in range(n):
    power = power * (i+1)
    power %= mod
print(power)

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):

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

Solution (Python):
import math
n = int(input())
ans = math.factorial(n) % (10**9+7)
print(ans)

Solution (Python):
N = int(input())
mod = 10**9 + 7
ans = 1
for i in range(N):
    ans *= (i+1)
    ans %= mod
print(ans)

Solution (Python):
N = int(input())
MOD = 10**9+7
ans = 1
for i in range(1, N + 1):
    ans *= i
    ans %= MOD
print(ans)

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right


from functools import reduce
from pprint import pprint

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

n = I()

mod = 10**9 + 7

import math

ans = math.factorial(n)
print(ans%mod)

Solution (Python):
n=int(input())
MOD=(10**9)+7
ans=1
for i in range(1,n+1):
    ans=((ans%MOD)*(i%MOD))%MOD
print(ans)

Solution (Python):
import math
n=int(input())
print(math.factorial(n)%1000000007)

Solution (Python):
n = int(input())
MOD = 10**9+7
p = 1
for i in range(1,n+1):
  p = (p*i) % MOD
print(p)

Solution (Python):
N = int(input())
MOD = 10**9+7
ans = 1

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

print(ans)

Solution (Python):
N = int(input())

mod = int(1e9)+7

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


print(ans)

Solution (Python):
M = 10**9+7

def factorial(n):
    f = 1
    for i in range(1,n+1):
        f = f*i%M
    return f

def comb(n,k):
    if n==0 or k == 0:
        return 1
    if n<k:
        return 0

    return perm(n,k)*inverse(factorial(k))%M

def mcomb(n,k):
    return comb(n+k-1,k)

def perm(n,k):
    if n==0 or k == 0:
        return 1
    if n<k:
        return 0

    p = 1
    for i in range(n-k+1,n+1):
        p = p*i%M

    return M

def inverse(a):
    return pow(a,M-2,M)
  
print(factorial(int(input())))

Solution (Python):
N = int(input())
p = 1
for i in range(N):
    p = p * (i + 1) % (1e9 + 7)
print(int(p))

Solution (Python):
import math
N = int(input())
print((math.factorial(N))%(10**9+7))

Solution (Python):
import math
N = int(input())
mod =10**9+7

print(math.factorial(N)%mod)

Solution (Python):
n = int(input())
mod = 10**9+7
ans = 1
for i in range(n):
    ans *= i+1
    ans %= mod
print(ans)

Solution (Python):
import math
import copy
import re
mod = 10**9+7

n = int(input())
neko = math.factorial(n)
print(neko%mod)

Solution (Python):
n=int(input())
mod=10**9+7
ans=1
for i in range(1,n+1):
    ans=ans*i%mod
print(ans)

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

Solution (Python):
import math

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

Solution (Python):
n = int(input())

ans = 1

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

print(ans)

Solution (Python):
from functools import lru_cache
import sys

sys.setrecursionlimit(1000000)

N = int(input())

def cnt_power(ans, n, cnt):
    if cnt>n:
        return ans
    elif (ans*cnt) >= (10**9+7) :
        ans = ans*cnt % (10**9+7)
        cnt += 1
        return cnt_power(ans, n, cnt)
    else:
        ans = ans*cnt
        cnt += 1
        return cnt_power(ans, n, cnt)

print(cnt_power(1, N, 1))

Solution (Python):
import sys
import math
import bisect

def main():
    n = int(input())
    m = 10 ** 9 + 7
    ans = 1
    for i in range(1, n + 1):
        ans = ans * i % m
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):


import math
print(math.factorial(int(input())) % 1000000007)

Solution (Python):
from functools import reduce

n = int(input())
mod = 10**9 +7
ans = reduce(lambda total, x: total * x % mod, range(1, n+1))

print(ans)

Solution (Python):
n = int(input())

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

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

Solution (Python):
import math

n = int(input())

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

Solution (Python):
from math import factorial


def main():
    n = int(input())

    power = factorial(n)
    ans = power % (10**9 + 7)
    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
import math
a = float(input())
print(math.factorial(a) %( 10**9+7))

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    answer=1
    n=int(input())
    for i in range(1,n+1):
        answer*=i
        answer%=10**9+7
    print(answer)
resolve()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import math
    n=int(input())
    print(math.factorial(n)%(10**9+7))
resolve()

Solution (Python):
import math

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

Solution (Python):
n = int(input())
import math
print(math.factorial(n)%(10**9+7))

Solution (Python):

n = int(input())

ans=1

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

Solution (Python):
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print(math.factorial(N)%MOD)


if __name__ == '__main__':
    main()

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

Solution (Python):
import math
N=int(input())
print(math.factorial(N)%(10**9+7))

Solution (Python):
n = int(input())

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

Solution (Python):
import math
n = int(input())
power = math.factorial(n) % (10 ** 9 + 7)
print(power)

Solution (Python):


n = int(input())
mod = 10 ** 9 + 7
ans = 1
for i in range(1, n + 1):
    ans = ans * i % mod
print(ans)

Solution (Python):

import numpy as np
N = int(input())


power = 1






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

Solution (Python):
import math
N=int(input())
print(math.factorial(N) % (10**9+7))

Solution (Python):
import math

N = int(input())

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

print(power)

Solution (Python):
MOD=10**9+7
N=int(input())

answer=1
for i in range(2,N+1):
  answer*=i
  answer%=MOD

print(answer)

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

Solution (Python):
n = int(input())
x = 1
for i in range(1,n+1):
    x=(i*x)%((10**9+7))
print(x)

Solution (Python):
N = int(input())
p = 1
for i in range(N):
    p *= (i + 1)
    p %= (1e9 + 7)
print(int(p))

Solution (Python):
import math
n = int(input())
print(math.factorial(n) % (10**9+7))

Solution (Python):
n = int(input())
pwr = 1
for i in range(1,n+1):
  pwr *= i
  if pwr>10**9+7:
    pwr = pwr%(10**9+7)
print(pwr%(10**9+7))

Solution (Python):
n = int(input())
ans = 1
for i in range(1, n +1):
    ans*= i
    ans = ans % (10**9 + 7)
print(ans)

Solution (Python):
import math
print(math.factorial(int(input()))%(10**9+7))

Solution (Python):
N = int(input())
sum=1

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

print(sum)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
print(math.factorial(N)%(10**9+7))

Solution (Python):
N=int(input())
import math
power=math.factorial(N)
print(power%(10**9+7))

Solution (Python):
n = int(input())

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

Solution (Python):
N = int(input())
import math
print((math.factorial(N)) % (10 ** 9 + 7))

Solution (Python):
N=int(input())
ans=1
i=1
while i<=N:
    ans=(ans*i)%(10**9+7)
    i+=1
print(ans)

Solution (Python):
n = int(input())
c = 1
t = 1
while t <= n:
  c = (c*t)%(10**9+7)
  t += 1
print(c)

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

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

Solution (Python):


n = int(input())

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

ret = power % (10 ** 9 + 7)

print(ret)

Solution (Python):
ans = 1
MOD = 10**9 + 7

for i in range(int(input())):
  ans *= i + 1
  ans %= MOD

print(ans)

Solution (Python):
N = int(input())
power = 1
C = 10**9+7
for i in range(1,N+1):
    power *= i
    power %= C


print(power)

Solution (Python):
N=int(input())
ans=1
for i in range(N):
    ans*=(i+1)
    ans=ans%(10**9 + 7)
print(ans%(10**9 +7))

Solution (Python):
N = int(input())
ans = 1
for i in range(1,N+1):
  ans *= i
  if ans > 10**9 + 7:
    ans %= 10**9 + 7
print(ans)

Solution (Python):
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  
    
    cnt = math.factorial(N)%(10**9+7)
    
    print(cnt)

Solution (Python):
N = int(input())
fact = 1
for integer in range(1,N+1):
    fact = fact * integer % 1000000007
print(fact)

Solution (Python):
N = int(input())
num = 1
for i in range(1, N+1):
    num *= i
    num %= 1000000007
print(num)