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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import math
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 math
n = int(input())

power = math.factorial(n)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Mod = 10**9 + 7
fac = [1]*(10**5+1)
for i in range(1,10**5 + 1):
  fac[i] = fac[i-1] * i % Mod
Ans = fac[N]
print(Ans)

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

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)

Submission status: Accepted

Solution code:
N = int(input())

power = 1
tmp = 1  # this is devided by 10^{9} + 7
prime = int(1e9 + 7)
for n in range(1, N + 1):
    tmp = tmp * n
    if tmp > prime:
        tmp = tmp % prime
print(tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def factorial(n):
    fact = 1
    for i in range(2, n+1):
        fact = (fact * i) % (10 ** 9 + 7)
    return fact


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

Submission status: Accepted

Solution code:
def factorial(N):
    fact = 1
    for i in range(2, N + 1):
        fact = (fact * i) % (10**9 + 7)
    return fact


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

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=j=1
for i in'a'*int(input()):a*=j;a%=10**9+7;j+=1
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

print(math.factorial(N) % P)

Submission status: Accepted

Solution code:
n = int(input())

INF = 10**9 + 7

ans = [0] * (10**5 + 1)
ans[0] = 1

for i in range(1,10**5 + 1):
    ans[i] = ans[i-1] * i % INF

print(ans[n])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 math
n=int(input())
pw=1
e=10**9+7
'''
for i in range(1,n+1):
    pw*=i
    print(i,pw)
'''
pw=math.factorial(n)
print(pw%e)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
from math import factorial
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 math

inf = 10 ** 9 + 7

print(math.factorial(int(input()))%inf)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
mod_lar = 10**9+7
ans =1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans%mod)

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
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
mod = pow(10, 9) + 7
for i in range(1, N+1):
  ans = ans * i % mod
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())
p=1
for i in range(1,n+1):
  p=p*i
  if p%10==0:
    p=p%(10**9+7)
print(p%(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:
# import bisect
# import copy
# import fractions
import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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

resolve()

Submission status: Accepted

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

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

def main():
    mod=10**9+7
    N=I()
    ans=1
    for i in range(N):
        ans*=(i+1)
        ans%=mod
        
    print(ans)

main()

Submission status: Accepted

Solution code:
N=int(input())
p=1
a=(10**9)+7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

from math import factorial
div = int(1e9 + 7)
ans  = factorial(N) % div
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## coding: UTF-8
s = int(input())

d = 1000000007
def multi_mod(a, x): #元の数aにxをかけて、10^9+7で割る。
    return (a * x) % d

n = 1
for i in range(1, s+1):
    n = multi_mod(n, i)
    #print(n)
print(n)

Submission status: Accepted

Solution code:
# import math
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter

import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
inN = int(input())
 
D=1000000000+7
p=1
for i in range(inN):
  p*=(i+1)
  if (D < p): p=p%D
 
print(str(p))

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%(10**9+7))
#457992974
# 計算の桁数を減らすことで処理が早くなる

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)
  if x >= 10**9+7:
    x = x-10**9-7
print(x%(10**9+7))
#457992974
# 計算の桁数を減らすことで処理が早くなる

Submission status: Accepted

Solution code:
import sys
import os
import math

MOD = 1000000007

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

    N = int(sys.stdin.readline().rstrip())
    print(math.factorial(N) % MOD)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# import collections # queue
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

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

Submission status: Accepted

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

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())
ret = 1
for i in range(2,N+1):
  ret *= i
  if 1000000007 <= ret:
    ret = ret%1000000007
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

mod = 1000000007

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

print(p % mod)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import math
def resolve():
    n = int(input())
    power = 1

    power = power * math.factorial(n)

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(*args):
    print(*args,file=sys.stderr)

def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
     
#input

def resolve():
    N,=pin()
    ans=1
    
    mod=7+(pow(10,9))
    for i in range(1,N+1):
        ans*=i        
        ans%=mod
    print(ans)
    
        #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()

"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
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)

if __name__=="__main__":resolve()

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc055/tasks/abc055_b

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

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

print(power)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem B - Training Camp

# input process
N = int(input())

# initialization
frac_num = 1
INF = 10**9 + 7

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

print(frac_num%INF)

Submission status: Accepted

Solution code:
def training(n):
    if n==1:
        return 1
    else:
        x=training(n-1)*n
        return x%mod
import sys
n=int(input())
sys.setrecursionlimit(10**9)
mod=10**9+7
print(training(n))

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
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))

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)

MOD = 1000000007  # type: int


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

    print(ans)

    return


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
def pow(i,n):
  ret = 1
  if n == 0: return ret
  elif n & 1: return i*pow(i,n//2)**2
  else: return pow(i,n//2)**2
mod = 10**9 + 7
def fac(n):
  ans = 1
  for i in range(1,n+1):
    ans *= i
    ans %= mod
  return ans
n = int(input())
print(fac(n))

Submission status: Accepted

Solution code:
# coding: utf-8

md = 1000000000 + 7

n = int(input().rstrip())

current = 1

for i in range(n):
    current *= (i+1)
    current = current % md

print(current)

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

Submission status: Accepted

Solution code:
import sys

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

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
	readline=stdin.readline
	N=int(readline())
	res=1
	mod=10**9+7
	for i in range(1,N+1):
		res*=i
		res%=mod
	print(res)
if __name__=="__main__":
	main()

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:
mod = pow(10, 9) + 7
def factorial(n):
    return fact[n]

N = pow(10, 5)  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    #inv.append((-inv[mod % i] * (mod // i)) % mod)
    #factinv.append((factinv[-1] * inv[-1]) % mod)

n = int(input())
print(factorial(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

ans %= mod
print(ans)

Submission status: Accepted

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

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

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

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

print(k)

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

power = 1
m = 10**9+7
for i in range(1,n+1):
    power *= i
    power = power%m
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())
def factorial(n, mod = 10**9+7):
    tmp = 1
    for i in range(1, n+1):
        tmp = (tmp * i) % mod
    return tmp

def main():
    ans = factorial(n)
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from functools import reduce
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    print(reduce(lambda a, b: a * b % MOD, range(1, N + 1), 1))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
inf =1000000007

x = 1
for i in range(1,n+1):
    x = x*i%inf

print(x)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
n = int(input())
print (math.factorial(n)%(10**9+7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

M = 10**9 + 7

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(tmp)

Submission status: Accepted

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

print(p)

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

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())
mod = 10**9 + 7
ans = 1
for i in range(2, n+1):
    ans *= i
    ans %= 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 *= i
    ans %= mod
# ans %= 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:
import math
n = int(input())
a = math.factorial(n) % (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:
n=int(input())
p=1
for i in range(1,n+1):
    p=p*i
    p=p%(10**9+7)
print(p)

Submission status: Accepted

Solution code:
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline())

mod = 10**9+7

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    exercising = int(input())
    answer = 1
    mod = 10 ** 9 + 7
    for i in range(2, exercising + 1):
        answer = (answer * i) % mod
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce 
def solve():
    mod = 10 ** 9 + 7
    N = int(input())
    print(reduce(lambda x,y: x*y%mod, list(range(1,N+1))))

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

def main():
    N = int(input())
    v = 10 ** 9 + 7
    ans = 1
    for x in range(2, N + 1):
        ans = (ans * x) % v
    print(ans)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC055

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 1
prime = 10 ** 9 + 7
for i in range(1, n + 1):
    ans = (ans * i) % prime
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 sys
input = sys.stdin.readline


def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        if fact > 10 ** 9 + 7:
            fact %= 10 ** 9 + 7
        fact *= integer

    return fact


n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())

power = 1
mod = 10 ** 9 + 7

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

print(power)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())

power = 1

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

print(power)