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

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

Submission status: Accepted

Solution code:
N = int(input())

devide = 10 ** 9 + 7

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

#power %= devide
print(power)

Submission status: Accepted

Solution code:
#再帰関数作ったら再帰回数の上限を超えてエラーになったっぽい
"""
def kaijo(n):
  if n ==1:
    return n
  return n * kaijo(n-1)
"""

import math

n = int(input())

print(math.factorial(n)%1000000007)

#print(kaijo(n)%1000000007)

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())
ans = 1
def kaijo(num):
    global ans
    ans *= num

for i in range(n,0,-1):
    kaijo(i)
    ans %= 1000000007

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
ans=1
DIV=10**9+7
while N>1:
  ans=(ans*(N%DIV))%DIV
  N-=1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())

p = 1

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
n=1
while N!=1:
  n*=N
  n=n%(10**9+7)
  N-=1
print(n)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    N = int(input())
    ans=1
    for i in range(1,N+1):
        ans = ans%(10**9+7) * i%(10**9+7)
        
    print(ans%(10**9+7))

if __name__ == '__main__':
    main()

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())
x=1 # 値、最初は1

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

print(x)

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:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    print(factorial(int(input())) % mod)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def main():
    N = int(input())
    p = 10**9 + 7
    j = math.factorial(N)

    print(j % p)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

power = 1
for n in range(1, N+1):
    power = (power*n) % int(1e9+7)

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
result=1

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

print(result%1000000007)

Submission status: Accepted

Solution code:
n = int(input())

#nの階乗の計算 n!
import math
k = math.factorial(n)

print(k%1000000007)

Submission status: Accepted

Solution code:

line = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(p % div)

Submission status: Accepted

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

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=ans%(10**9+7)
print(ans%(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())
import math 
print(math.factorial(n)%((10**9)+7))

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:
import math

n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examB(mod):
    N = I()
    cur = 1
    for i in range(1,N+1):
        cur = (cur*i)%mod
    print(cur)


import sys
import copy
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB(mod)

Submission status: Accepted

Solution code:
# ABC 055: B – Training Camp
from math import factorial

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:
# ABC 055: B – Training Camp
from math import factorial

n = int(input())

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

Submission status: Accepted

Solution code:
A = int(input())
b = 1
mod = 1000000007
for a in range(1,A+1):
  b = b*a % mod
print(b)

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:
sup = int(input())

INF = 10 ** 9 + 7 

pow = 1

for i in range(1,sup + 1):
  pow = pow * i % INF
  
print(pow)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial as f
print(f(int(input())) % (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())
ans = 1
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def main():
    n = inp()
    res = 1
    for i in range(1,n+1):
        res = res * i % mod
    print(res%mod) 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

m = 10 ** 9 + 7

print(math.factorial(n) % m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mod = 10**9 + 7

def modFact(n):
    fact = 1
    for i in range(1,n+1):
        fact = (fact % mod * i % mod) % mod
    return fact 

n = int(input())
print(modFact(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

i=1

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

Submission status: Accepted

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

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

pow = 1

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

print(pow)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
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:
mod = int(1e9+7)
n = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import factorial
mod = int(1e9+7)
n = int(input())

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

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:
import math
n = int(input())
ans = math.factorial(n)

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

Submission status: Accepted

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

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 % mod)

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

Submission status: Accepted

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

Submission status: Accepted

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

n = math.factorial(n)

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

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:
def factorial(N):
    a = 1
    for n in range(2,N+1):
        a = a*n % (10**9 + 7)
    return a
 
if __name__ == '__main__':
    N = int(input())
    print(factorial(N))

Submission status: Accepted

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))



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:
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:
#B - Training Camp
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:
n = int(input())
power = 1
for i in range(n):
    power = power * (i + 1)
    if power >= 10 ** 4:
        power = power % (10 ** 9 + 7)

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
P = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

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:
import math
N=int(input())
ans=math.factorial(N)
print(ans%(10**9 +7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
import math
print(math.factorial(n) % (10**9+7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

mod = 1000000007

n = int(input())

print(math.factorial(n) % mod)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(result)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
power = 1
for i in range(N):
    power *= (i+1)
    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())
ans=list()
ans.append(1)
for i in range(1,n):
    ans.append(ans[i-1]*(i+1)%(pow(10,9)+7))
print(ans[n-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

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
print( math.factorial(int(input())) % (1000000000+7) )

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t = 1
    for i in range(1, n + 1):
        t *= i
        t %= (10 ** 9 + 7)
    print(t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
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 math
n=int(input())
p=1
for i in range(1,n+1):
    p=p*i%1000000007

print(p)

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

print(ans)

Submission status: Accepted

Solution code:
from math import factorial

print(factorial(int(input())) % (10**9+7))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(Ans)

Submission status: Accepted

Solution code:
N=int(input())

ans=1

BIG=1000000007

for n in range(1,N+1):
  ans=ans*n
  ans=ans%BIG

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
res = 1
for i in range(1, N+1):
    if res >= (10**9+7):
        res %= (10**9+7)
        res *= i
    else:
        res *= i
print(res % (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:
MOD = 1000000007
power = 1
N = int(input())
for i in range(N):
    power = (power* (i + 1)) % MOD
print(power)

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

Submission status: Accepted

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

#div = pow(10,9)+7
print(math.factorial(num)%(pow(10,9)+7))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def main():
    ans = 1
    t = 0
    while t < N:
        t += 1
        ans *= t
        ans %= 1000000007
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N=int(input())

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

Submission status: Accepted

Solution code:
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 math
N = int(input())
MOD = 10 ** 9 + 7

print(math.factorial(N) % MOD)

Submission status: Accepted

Solution code:
import math

print(math.factorial(int(input())) % (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())
power = 1
for i in range(1, N+1):
  power = power * i % 1000000007
print(power)

Submission status: Accepted

Solution code:
from math import factorial

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
INF = 1000000000+7

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

Submission status: Accepted

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

Submission status: Accepted

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

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        ans = 1
        mod = 10 ** 9 + 7
        for i in range(2, N + 1):
            ans = (ans * i) % mod
        print(ans % (10 ** 9 + 7))


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:
#coding:utf-8

n = int(input())
p = 1

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

print(p)

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:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    ans=1
    n=int(input())
    for i in range(2,n+1):
        ans=ans*i%MOD
    print(ans)
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(power)

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

print(ans)

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

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

print(ans)

Submission status: Accepted

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

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

    MOD = int(1e9) + 7

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

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:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

# input
N = int(input())

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

# output
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

# print(N)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
mod = int(1e9)+7

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 1

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

print(res)

Submission status: Accepted

Solution code:
n = int(input())

ans = 1

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(power)

Submission status: Accepted

Solution code:
n = int(input())

from math import factorial

power = factorial(n)
mod = 10 ** 9 + 7
ans = power % 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:
import math
N = int(input())
p = math.factorial(N)
print(int(p%(10**9+7)))

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

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

N = int(input())
print(frac(N))

Submission status: Accepted

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

a = pow(10, 9) + 7

power = math.factorial(N)

print(power% a)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
import math
n=int(input())

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