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

mod = 10 ** 9 + 7

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

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

Submission status: Accepted

Solution code:

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

a = 10**9 + 7

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

n = int(s)

x = 1

for num in range(n):
    x *= num + 1
    x = x % ((1000000000) + 7)



print(x)

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

n = int(input())

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

print(power)

Submission status: Accepted

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

for i in range(1, n + 1):
    b *= i
    b %= a
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

print(int(ans))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(power % 1000000007)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import factorial

N = int(input())

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

N = i()
print(fact(N,mod))

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

Submission status: Accepted

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

if __name__ == "__main__":
  resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n = int(input())
    p = 1
    mod = 10**9+7
    for i in range(1,n+1):
        p *= i
        p %= mod
    print(p)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
M=10**9+7
K=1

for i in range(1,N+1):
    K=(K*i)%M
print(K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())

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

print(res)

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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) % (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:
import sys;input = lambda : sys.stdin.readline()
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())
k = 1

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

print(k)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
mod = 1000000007

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

print(power)

Submission status: Accepted

Solution code:
n = int(input())

MOD = 1000000000 + 7

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

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

power = math.factorial(n)
div = (10 ** 9) + 7

print(power % div)

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

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

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:
from collections import defaultdict
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

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

Submission status: Accepted

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

# In[1]:


N = int(input())


# In[2]:


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


# In[ ]:

Submission status: Accepted

Solution code:
N = int(input())

power = 1

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

print(power)

Submission status: Accepted

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

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

pow = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

mod=1000000007

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

print(p)

Submission status: Accepted

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

print(prod)

Submission status: Accepted

Solution code:
import sys
N = int(input())
if N < 0 or N > 100000:
    sys.exit()
power = 1
for I in range(1,N+1):
    # print("power="+str(power))
    # print("I="+str(I))
    power = power * I % (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())

m = 1000000007

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
def fact(n,mod):
    f = 1
    for m in range(1,n + 1):
        f *= m
        f %= mod
    return f

mod = 10**9+7
N = i()
print(fact(N,mod))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#! env python
# -*- coding: utf-8 -*-

import os
import sys


# ac_py.main
# Date: 2020/06/14
# Filename: main 
# Author: acto_mini

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

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

    print(power)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    power = 1

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

    return power

print(main())

Submission status: Accepted

Solution code:
import math

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

ans = math.factorial(N)

print(ans % x)

Submission status: Accepted

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

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

FACTOR = 10 ** 9 + 7

num = 1
for i in range(1, N+1):
    num *= i
    k, r = divmod(num, FACTOR)
    num = r

print(r)

Submission status: Accepted

Solution code:
import math

N = int(input())

num = math.factorial(N)

k, r = divmod(num, 10**9 + 7)
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()
    print(math.factorial(N)%MOD)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()
    ret = 1
    for n in range(1, N + 1):
        ret *= n
        ret %= MOD
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!python3

# input
N = int(input())

MOD = 10 ** 9 + 7


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

print(power)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

print(training(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())

print(math.factorial(n)%mod)

Submission status: Accepted

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

Submission status: Accepted

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

import math

def main():
    n = int(input())
    ans =math.factorial(n)
    print(ans%1000000007)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)

MOD = (10**9) + 7


def main():
    ans = 1
    N = int(input().strip())
    for n in range(1, N + 1):
        ans *= n
        ans = ans % MOD
    return ans


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

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:
def factorial(x, mod=10**9+7):
    # x!
    # 階乗
    # ex) factorial(5) = 120
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp

a=int(input())
print(factorial(a))

Submission status: Accepted

Solution code:
n = int(input())

power = 1

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import math

N = int(input())
print(math.factorial(N) % 1000000007)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

n = int(input())


def func(times):
    power = 1
    divide_num = 10 ** 9 + 7

    for i in range(times):
        power *= (i + 1)
        power %= divide_num

    print(power)


func(times=n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## B - Training Camp
N = int(input())
val = 1
for n in range(1,N+1):
    val = (val * n) % (10 ** 9 + 7)
print(val)

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

Submission status: Accepted

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

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

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

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

res = 1

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    mod = 10**9+7

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 11:26:40 2020

@author: naoki
"""

N = int(input()) # trainingをする回数
power = 1 # 最初のパワー

for i in range(1,N+1):
    power = (power*i)%(10**9+7) # powerを10^9+7で割った値を出力
print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
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())

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

print(training(n))

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
INF = 10**9 + 7

N = int(input())
power = 1

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INF = 10**9 + 7

N = int(input())
power = 1

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

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

Submission status: Accepted

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

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)