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 sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def power(N):
	if N == 1:
		return 1
	else:
		return (N*power(N-1))%mod

N = INT()
print(power(N))

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

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

  
print(ans)

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

print(factorial(int(input())))

Solution (Python):

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

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

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

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)


def main():
    n=int(input())
    ans=1
    for a in range(1,n+1):
        ans*=a
        ans%=mod
    print(ans)
main()

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

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

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

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''












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

def main():

    w=1
    j=0
    k=0
    mod=10**9+7
    dl=[]
    po=1
    n=int(input())
    
    for i in range(1,n+1):
        po=(po*i) % mod
    print(po)
    
    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    "1行1つの整数を入力を取得し、整数と取得する"
    
    
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    
    


    
    
    
    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''












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

def main():

    w=1
    j=0
    k=0
    dl=[]
    po=1
    n=int(input())
    print(factorial(n))
    
    
    
    
    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    "1行1つの整数を入力を取得し、整数と取得する"
    
    
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    
    


    
    
    
    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

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())

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

print(power)

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())
ans = 1
mod = 10**9 + 7
for i in range(1, n + 1):
    ans = ans * i % mod
print(ans)

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

print(ans)

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


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

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

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

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

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):
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())
p = 1

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

print(p)

Solution (Python):
import sys
import math

input = sys.stdin.readline
MOD = 1000000007

N = int(input())

print(math.factorial(N)%MOD)

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

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

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

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

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

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left


def main():
    n = II()
    m = 1
    for i in range(1,n+1):
        m *= i
        m %= 10**9+7
    print(m%(10**9+7))
if __name__ == '__main__':
    main()

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

Solution (Python):
import math

N=input()
N=int(N)

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

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

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

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


    
if __name__ == '__main__':
    main()

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=(ans*i)%(10**9+7)
print(ans)

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):
n = int(input())
ans = 1
mod = 10**9+7
for i in range(1, n+1):
  ans *= i
  ans %= mod
print(ans)

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

print(x)

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

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):
n=int(input())
mod=10**9+7
p=1
for i in range(n):
    p*=i+1
    p=p%mod
print(p)

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

P = 1

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

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())
i=1
j=1
while j!=n+1:
    i=(i*j)%(10**9+7)
    j+=1
print(i)

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

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

print(power)

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

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

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 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):
def resolve():
    N = int(input())
    power = 1
    for i in range(1, N+1):
        power *= i
        power = power%(10**9+7)
    print(power)


if '__main__' == __name__:
    resolve()

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

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

Solution (Python):
lim = 1000000007
result = 1
n = int(input())

for q in range(n):
    result = result % lim
    result *= q + 1
print(result % lim)

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

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

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

Solution (Python):
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(input())
    ans = math.factorial(N)%MOD
    print(ans)



if __name__ == '__main__':
    main()

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

Solution (Python):
n= int(input())
def fact_m(n, modulus=10**9+7):
    ans=1
    if n <= modulus//2:
        for i in range(1,n+1):
            ans = (ans * i) % modulus   
    else:
        for i in range(1,modulus-n):
            ans = (ans * i) % modulus
        ans = modinv(ans, modulus)

        if n % 2 == 0:
            ans = -1*ans + modulus
    return ans % modulus
print(fact_m(n))

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

N = int(sys.stdin.readline())
ans = 1
MOD = 10 ** 9 + 7
for i in range(1, N + 1):
    ans = ans * i % MOD
print(ans)

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

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())
p = 1
for i in range(1,N+1):
  p = (p*i)%(10**9+7)

print(p)

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 = ans * i % (10**9+7)
    
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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

    print(res)


if __name__ == '__main__':
    resolve()

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

print(ans)

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):
n = int(input())
mod = 10**9 + 7

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

print(pow)

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

print(ans)

Solution (Python):
from functools import reduce

N = int(input())
div = pow(10, 9) + 7
print(reduce(lambda ans, n: ans * n % div, range(1, N + 1)))

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

print(ans)

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

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(n):
    ans=ans*(i+1)%1000000007
print(ans)

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

Solution (Python):
n = int(input())
p=1
def cal(a,b):
  return a*b%1000000007

for i in range(1,n+1):
  p = cal(p,i)
  
print(p)

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

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

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())

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

print(ans)

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())

r = 1

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

print(r)

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

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

Solution (Python):
def factorial(n, mod):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
        fact %= mod
    return fact

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

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
num = int(input())
result = math.factorial(num) % (10 ** 9 + 7)
print(result)

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

Solution (Python):
import math

N = int(input())

print(math.factorial(N)%int(1e9+7))

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

MOD = int(1e9) + 7
a = 1
for i in range(1, N + 1):
    a = a * i % MOD

print(a)

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

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

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

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

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

power = 1
for i in range(n):
    power = power * (i+1)
    if power > 1000000007:
        power = power % 1000000007

print(power)

Solution (Python):
import numpy as np
n = int(input())

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

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

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

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

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())

ans = 1
MOD = 10**9 + 7

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

print(ans)

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


if __name__ == '__main__':
   main()

Solution (Python):
from math import factorial
def myAnswer(N:int) ->int:
   ans =factorial(N)
   return ans % (10**9 + 7)

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   print(myAnswer(N))


if __name__ == '__main__':
   main()

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

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

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

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

n = int(input())
cnt = 1
for i in range(1,n+1):
    cnt *= i 
    cnt %= MOD
print(cnt)

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

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

print(ans)

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

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

power = 1

for i in range(1, _input + 1):
  if power >= 1000000007:
    power %= 1000000007
  power *= i

power %= 1000000007

print(power)

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

Solution (Python):
import functools

N = int(input())
print(functools.reduce(lambda x, y: x * y % 1000000007, range(1, N+1)))

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):
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):
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())
MOD = 10**9 + 7

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

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


if __name__ == "__main__":
    main()

Solution (Python):
N=int(input().rstrip())
a=1
mod=1e9+7
for i in range(1,N+1):
  a*=i
  a%=mod
print(int(a))