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.



Sample input:
3


Sample output:
6

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
N = int(input())

# N!を(10^9+7)で割った余りを求める
# N!そのものを求める必要はなく、
# x = i*x (mod 10^9+7) と更新していけばよい
M = 10**9 + 7
s = 1
for i in range(1, N+1):
  s *= i
  s %= M
  
print(s)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
x=1
for i in range(n):
  x*=(n-i)
  if x>10**9+7:
    y=x//(10**9+7)
    x-=y*(10**9+7)

print(x)

Submission status: Accepted

Solution code:
n = int(input())
MOD = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    cur = 1
    for i in range(1, N + 1):
        cur *= i
        cur %= MOD

    print(cur)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
import collections
import bisect

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MOD = 10**9+7

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = 10**9 + 7

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

mod = 10**9+7
ans = 1

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



print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Training Camp
def main():
    import math
    n = int(input())
    
    
    print(math.factorial(n)%(10**9+7))

  
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

x=1

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p = 1
c = 10**9 + 7

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

Submission status: Accepted

Solution code:
a = int(input())
snk = 1
for i in range(1, a+1):
  snk *= i
  if snk > 1000000007:
    snk %= 1000000007
print(snk%1000000007)

Submission status: Accepted

Solution code:
n = int(input())

ans =1
for i in range(2,n+1):
    ans*=i
    ans = ans%int(1e9+7)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

a = math.factorial(n)
b = 10**9 + 7

print(a%b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Training Camp 
N = int(input())

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

mod = 10**9+7 #出力の制限
N = 10**5+1
def cmb(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
def p(n,r):
    if ( r<0 or r>n ):
        return 0
    return g1[n] * g2[n-r] % mod

g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
# a = cmb(n,r)

n = onem()
print(p(n,n))

Submission status: Accepted

Solution code:
from math import factorial

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

Submission status: Accepted

Solution code:
import math
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

N = I()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
mod = 10**9+7

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
ans = 1
for i in range(N):
    ans *= (i + 1)
    ans = ans % (10**9 + 7)
print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n =int(raw_input())

q = 1
mod = 10 ** 9 + 7
for u in range(2, n+1):
	q *= u
	q %= mod
print q

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def FactorialMod(N,Mod):
    if N>=Mod:
        return 0
    else:
        FactM = 1
        for TF in range(1,N+1):
            FactM = (FactM*TF)%Mod
        return FactM
print(FactorialMod(int(input()),10**9+7))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 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(input())

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

    print(ans)


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

Submission status: Accepted

Solution code:
N = int(input())
power = 1
K = 10 ** 9 + 7
for n in range(N):
  power *= (n + 1)
  if power >= K:
    power %= K
print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
mod=10**9+7
power=1

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 1

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

Submission status: Accepted

Solution code:
N = int(input())
P = 1
D = 10**9 + 7

for n in range(1, N+1):
    P = (P * n) % D

print(P%D)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

factorial=[1 for i in range(N+1)]
for i in range(1,N+1):
    if i==1:factorial[i]=1
    else:factorial[i] = factorial[i-1]*i % mod
      
print(factorial[N])

Submission status: Accepted

Solution code:
N = int(input())

ans = 1

for i in range(N):
  ans *= i + 1
  if ans > 1000000007:
    ans = ans % 1000000007

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
import sys
a = sys.stdin.readline()
A = int(a)
P = 1
I = 1 
W = 10 ** 9 + 7
while I <= A:
    P *= I
    I += 1
    P %= W
print(P)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


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

print(power)

Submission status: Accepted

Solution code:
N = int(input())

def mod(num):
    return num % (10 ** 9 + 7)
    
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

print(pro)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
mod = 10**9 + 7

N = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    answer = 1
    modulo = 10**9+7
    for i in range(1, N+1):
        answer = (answer*i)%modulo
    return answer


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
from math import factorial as fc
print(fc(N)%(10**9+7))

Submission status: Accepted

Solution code:
n = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Noob

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

power = 1

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

print(power)

Submission status: Accepted

Solution code:
n = int(input())

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

print(power)

Submission status: Accepted

Solution code:
mod = 10**9+7

N = int(input())
a = 1
for n in range(N):
    a = a*(n+1)%mod
print(a)

Submission status: Accepted

Solution code:
n = int(input())

mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import math

def main():

    N = int(input())

    ans = math.factorial(N)

    ans %= (10 ** 9 + 7)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
# ABC0555 - B - Training Camp

N=int(input())

ans=1

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

print(ans)

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    mod = int(1e9 + 7)
    n = I()
    p = 1
    for i in range(1, n+1):
        p = (p*i)%mod
    print(p)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
class Factorial():
    def __init__(self, mod=10**9 + 7):
        self.mod = mod
        self._factorial = [1]
        self._size = 1
        self._factorial_inv = [1]
        self._size_inv = 1
    
    def __call__(self, n):
        return self.fact(n)
    
    def fact(self, n):
        ''' n! % mod '''
        if n >= self.mod:
            return 0
        self._make(n)
        return self._factorial[n]
    
    def fact_inv(self, n):
        ''' n!^-1 % mod '''
        if n >= self.mod:
            raise ValueError('Modinv is not exist! arg={}'.format(n))
        self._make_inv(n)
        return self._factorial_inv[n]
    
    def comb(self, n, r):
        ''' nCr % mod '''
        if r > n:
            return 0
        t = self.fact_inv(n-r)*self.fact_inv(r) % self.mod
        return self(n)*t % self.mod
    
    def comb_with_repetition(self, n, r):
        ''' nHr % mod '''
        t = self.fact_inv(n-1)*self.fact_inv(r) % self.mod
        return self(n+r-1)*t % self.mod
    
    def perm(self, n, r):
        ''' nPr % mod '''
        if r > n:
            return 0
        return self(n)*self.fact_inv(n-r) % self.mod
    
    @staticmethod
    def xgcd(a, b):
        '''
        Return (gcd(a, b), x, y) such that a*x + b*y = gcd(a, b)
        '''
        x0, x1, y0, y1 = 0, 1, 1, 0
        while a != 0:
            (q, a), b = divmod(b, a), a
            y0, y1 = y1, y0 - q * y1
            x0, x1 = x1, x0 - q * x1
        return b, x0, y0
    
    def modinv(self, n):
        g, x, _ = self.xgcd(n, self.mod)
        if g != 1:
            raise ValueError('Modinv is not exist! arg={}'.format(n))
        return x % self.mod
    
    def _make(self, n):
        if n >= self.mod:
            n = self.mod
        if self._size < n+1:
            for i in range(self._size, n+1):
                self._factorial.append(self._factorial[i-1]*i % self.mod)
            self._size = n+1
    
    def _make_inv(self, n):
        if n >= self.mod:
            n = self.mod
        self.make(n)
        if self._size_inv < n+1:
            for i in range(self._size_inv, n+1):
                self._factorial_inv.append(self.modinv(self._factorial[i]))
            self._size_inv = n+1

print(Factorial()(int(input())))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    mod = 10**9+7

    N = int(input())

    ans = 1

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

print(pow)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    large_p = 10 ** 9 + 7
    n = int(input())
    r = 1
    for i1 in range(1, n + 1):
        r = (r * i1) % large_p

    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
power = 1
for i in range(1,n+1) :
    power *= i
    if power >= 1e9+7 :
        power %= 1e9+7
print(int(power))

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(power)