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 sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
n=int(input())
a=1
big=1000000007
for i in range(1,n+1):
	a=a*i%big
	
print(a)

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
n=int(input())
a=1
for i in range(1,n+1):
	a=a*i%1000000007
	
print(a)

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())
ans = 1
for i in range(2,n+1):
  ans = (i*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())
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 ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

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

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:
# -*- coding: utf-8 -*-

import math

N = int(input())

power = 1

mod = 10 ** 9
mod += 7

power = math.factorial(N)

print(power % mod)

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:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

mod = 10 ** 9 + 7

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from math import factorial

input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
#ABC 055 B #Training Camp

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

Submission status: Accepted

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

Submission status: Accepted

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

print(P)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n=int(input())
pow=math.factorial(n)
print(pow%(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:
# -*- coding: utf-8 -*-
n = int(input())
base = 10**9 + 7
result = 1

for i in range(1, n+1):
    result *= i
    result = result % base

print(result)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    p = 1
    mod = pow(10, 9) + 7
    for i in range(1, N+1):
        p *= i
        p %= mod
    return p

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

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

Submission status: Accepted

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

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 sys
stdin = sys.stdin
sys.setrecursionlimit(100001)
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

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

print(fact)

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

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

mod = 1000000007
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:
from math import factorial

N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

factN=math.factorial(N)

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

Submission status: Accepted

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

Submission status: Accepted

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

print(x)
#import numpy as np
#n=int(input())
#print(np.prod([i+1 for i in range(n)]))
#print(np.prod([i+1 for i in range(n)])%((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())
import math
print(math.factorial(n)%(7+10**9))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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:
# -*- 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:
N = int(input())
result = 1
TEISU = 10 **9 + 7

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

Submission status: Accepted

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

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())
power = math.factorial(N)
print(power % 1000000007)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
print(int(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:
n=int(input())
d=1
for i in range(n+1)[1:]:
  d *= i
  d %= 10**9+7
print(d)

Submission status: Accepted

Solution code:
n=int(input())
def a(x):
  if x==1:
    return 1
  else:
    d=1
    for i in range(x+1)[1:]:
      d *= i
      d %= 10**9+7
    return d
print(a(n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")

MOD = 1000000007  # type: int


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

    return


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 math

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

print(a)

Submission status: Accepted

Solution code:
N = int(input())

max_num = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

print(p)

Submission status: Accepted

Solution code:
from math import factorial

n = int(input())
print(factorial(n) % (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())
MOD = 10 ** 9 + 7
factrial = [0] * (n + 1)

factrial[1] = 1

for i in range(2, n + 1):
    factrial[i] = (factrial[i - 1] * i) % MOD
print(factrial[n])

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

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

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

Submission status: Accepted

Solution code:

N = int(input())

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

print(pow)

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

import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = int(input())

sunuke = 1

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


print(sunuke)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
#ABC055a
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

print(math.factorial(a) % (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())

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

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

Submission status: Accepted

Solution code:
""" abc055_b """

import sys
from functools import reduce

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1)! = a'H + b'
    #
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    # a' = a(N+1) + int(b(N+1)/H)
    # b' = b(N+1) % H
    #
    _b = reduce(lambda b, n: (b * n) % H, range(1, _n + 1), 1)

    print(_b)

if __name__ == '__main__':
    _main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
""" abc055_b """

import sys
from functools import reduce

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)

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

print(power)

Submission status: Accepted

Solution code:
import math as m

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
#1,000,000,007
tmp = 1
for i in range(1,num+1):
  tmp = tmp*i
  tmp = tmp % 1000000007
print(tmp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

a =1

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

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

INF = (10 ** 9) + 7
ans = 1
for i in range(1, N + 1):
    ans = (ans * i) % INF
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
for i in range(1, n+1):
    ans = ans * i
    ans = ans % ((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
    ans = ans % ((10 ** 9)+7)  # 途中で割り算の余りを求めても、最終結果は同じになる

print(ans)

Submission status: Accepted

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

ans = math.factorial(n)  # nの階乗を計算

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(int(p))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
#ABC 55, B - training camp
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())
res = 1
for num in range(1, n+1):
    res = res * num
    res = res % (10**9 + 7)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

mod=10**9+7

ans=1

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

print(ans)

Submission status: Accepted

Solution code:
import sys

def dfs():
    return

def resolve():
    N = int(input())
    power = 1

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

    print(power)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N = int(input())

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

print(int(ans))

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = math.factorial(N) % 1000000007

print(ans)

Submission status: Accepted

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


main()

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(num)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools

MOD = 1000000007  # type: int

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


# Generated by 1.1.4 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 math

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

Submission status: Accepted

Solution code:
def solve():
    n = read()
    result = think(n)
    write(result)


def read():
    return read_int(1)[0]


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n):
    p = 10 ** 9 + 7
    return mod_fact(n, p)

def mod_fact(n, p):
    if n == 1:
        return 1 % p

    result = 1 % p
    for i in range(n):
        r_1 = result % p
        r_2 = (i + 1) % p
        result = (r_1 * r_2) % p
    return result

def write(result):
   print(result)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(P)