Problem:


Score : 200 points

Problem Statement

Snuke loves working out. He is now exercising N times.

Before he starts exercising, his power is 1. After he exercises for the i-th time, his power gets multiplied by i.

Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Constraints

1 ≤ N ≤ 10^{5}

Input

The input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^{9}+7.

Sample Input 1

3

Sample Output 1

6

After Snuke exercises for the first time, his power gets multiplied by 1 and becomes 1.

After Snuke exercises for the second time, his power gets multiplied by 2 and becomes 2.

After Snuke exercises for the third time, his power gets multiplied by 3 and becomes 6.

Sample Input 2

10

Sample Output 2

3628800

Sample Input 3

100000

Sample Output 3

457992974

Print the answer modulo 10^{9}+7.



Sample input:
3


Sample output:
6

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial

N = int(input())
ans = factorial(N)
print(pow(ans, 1, (10 ** 9 + 7)))

Submission status: Accepted

Solution code:
from math import factorial

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


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())
#W,a,b=map(int,input().split())
#N=input()
ans=1
MOD=10**9+7
for i in range(N):
    i+=1
    ans*=i
    ans%=MOD
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math

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

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

input = sys.stdin.readline

n = int(input())

power = 1

for index in range(n):
    power *= (index + 1)
    power %= 1000000007

print(power)

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

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

Submission status: Accepted

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

Submission status: Accepted

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

print(res)

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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%(10**9+7)
print(ans)

Submission status: Accepted

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


abc()

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

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

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

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import string
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())

a = math.factorial(N) % (10 ** 9 + 7)
print(a)
# print(pow(2, N , 10 ** 9 + 7))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

answer = 1
for n in range(1,N+1):
  answer *= n
  answer %= MOD

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

p = 1

li = [i for i in range(1, n+1)]

for i in li:
  p = p*i % (10**9+7)
  
print(p)

Submission status: Accepted

Solution code:
import math

n=int(input())

num=math.factorial(n)

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

Solution code:
import math

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

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

    main(N)

Submission status: Accepted

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

print(power)

Submission status: Accepted

Solution code:
import math

n=math.factorial(int(input()))

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(cnt%(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("{}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    power = 1
    for i in range(1, N + 1):
        power = (i * power) % (10 ** 9 + 7)
    return power


if __name__ == "__main__":
    ret = solve(inputs(1))
    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:
n = int(input())
from functools import reduce
print(reduce(lambda x,y:x*y%1000000007,list(range(1,n+1))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

# 1 * 1 * 2 * 3 * 4 * 5 * ... * i % (10^9 + 7)
mod = 1
for n in range(N):
    # 先にmodを取った値を掛け算していく
    mod = mod % (pow(10, 9) + 7)
    mod = mod * (n + 1)
else:
    # 最後にもう１度modを取る
    mod = mod % (pow(10, 9) + 7)
    print(mod)

Submission status: Accepted

Solution code:
N = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Training Camp
https://atcoder.jp/contests/abc055/tasks/abc055_b

"""
import sys


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


def main(args):
    N = int(input())
    ans = solve(N)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

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:
from functools import reduce
N = int(input())
print(reduce(lambda acc, n: acc * n % (10**9 + 7), range(1, N + 1), 1))

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

power = 1
mod = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def fraction(N):
  w = N
  for x in range(1, N):
    w = (w * x) % (1e9 + 7)
  return w
print("{:.0f}".format(fraction(int(input()))))

Submission status: Accepted

Solution code:
#coding: utf-8

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

Submission status: Accepted

Solution code:
def process(N):
    ans = 1
    while N > 1:
        ans = ans * N % (10**9 + 7)
        N -= 1
    return ans

if __name__ == '__main__':
    n = int(input().strip())
    print(process(n))

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

result = 1
for i in range(1, n + 1):
    result = (result * i) % (1000000000 + 7)
    
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from sys import stdin 
N = int(stdin.readline().rstrip())
print(math.factorial(N) % (10**9+7))

Submission status: Accepted

Solution code:
import math

n = int(input())

f = math.factorial(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    ans = 1
    mod = 1000*1000*1000 + 7
    for i in range(1, n+1):
        ans *= (i%mod)
        ans %= mod
    print(ans)

solve()

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

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

print(p)

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
i = 1
while(n>0):
    i *= n
    n -= 1
    i = i%int(1e+9+7)
print(i)

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

Submission status: Accepted

Solution code:
maxTime = int(input())

n = 1
div = pow(10,9) + 7

for i in range(1, maxTime+1):
    n = (n * i) % div

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

n = int(input())
ans = 1
C = pow(10, 9)+7

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import accumulate
N=int(input())
n=[int(i) for i in range(1,N+1)]
a=1
for k in n:
    a*=k
    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:
import math
n = int(input())
mod = 10**9+7
print(math.factorial(n)%mod)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math;print(math.factorial(int(input()))%int(7+1e9))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

mod = 10 ** 9 + 7

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

Solution code:
N = int(input())
p = 1
i = 0
mod = 10**9+7
while i < N:
    i += 1
    p *= i
    p %= mod
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 入力
N=int(input())

# パワー（初期値1）
p=1

for i in range(N):
  p*=(i+1)

  # 余りをとる
  p%=1000000007

# 出力
print(p)

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

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

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

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

Submission status: Accepted

Solution code:
# ABC055B - Training Camp
from math import factorial

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

Submission status: Accepted

Solution code:
N = int(input())
x = 1
for i in range(2, N+1):
    x =(x * i)%(10**9+7)
print(x%(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:
import sys
from collections import Counter
import math

n = int(input())
pow = 1
m = 10 ** 9 + 7

print(math.factorial(n) % m)

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:
MAX = 10**9 + 7
def solve():
    N = int(raw_input())
    ret = 1
    for i in range(1,N+1):
        ret *= i
        if ret > MAX:
            ret %= MAX
    print str(ret)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def read_input():
    n = int(input())
    return n

def submit():
    n = read_input()

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

        if acc > limit:
            acc %= limit

    print(acc)


if __name__ == '__main__':
    submit()

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:
# -*- coding utf-8 -*-
n=int(input())
x=1

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


print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial
print(factorial(int(input())) % (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
x = 10**9 + 7
for i in range(1, N + 1):
    ans *= i
    if ans > x:
        ans = ans % x
print(ans)

Submission status: Accepted

Solution code:
n = int(input().split()[0])
warukazu = 10 ** 9 + 7
x = 1
for i in range(1, n+1):
    x = (x * i) % warukazu

print(x % warukazu)

Submission status: Accepted

Solution code:
N = int(input())

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

print(power)

Submission status: Accepted

Solution code:
N = int(input())

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

sum = 1

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


print(sum)

Submission status: Accepted

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

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

print(math.factorial(int(input())) % (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:
# -*- coding utf-8 -*-
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:
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:
def main():
    input = sys.stdin.readline
    try:
        n = int(input())
        p = 1
        for i in range(1, n + 1):
            p = p * i % (10**9+7)
        print(p)
        
    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    MOD = 10**9 + 7

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

    return ans


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    f = math.factorial(N)
    print(f%(10**9+7))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
def fact(n):
    val=1
    for i in range(2,n+1):
        val*=i
        val%=1000000007
    return val
print(fact(N))

Submission status: Accepted

Solution code:
import math

N = int(input())

print(math.factorial(N) % 1000000007)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

result_mod = 1

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

print(result_mod)

Submission status: Accepted

Solution code:
n = int(input())

rem = 1
for i in range(n):
  rem = rem * (i + 1) % (1e9 + 7)
print(int(rem))

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())
Q = 1000000007

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

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

m = 10 ** 9 + 7

print(math.factorial(n) % m)

Submission status: Accepted

Solution code:
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:
def training_camp(N: int) -> int:
    MOD = 10 ** 9 + 7
    ret = 1
    for n in range(N):
        ret = (ret * (n + 1)) % MOD
    return ret


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

Submission status: Accepted

Solution code:
n, = map(int, input().split())
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(1,n+1):
  ans=ans*i%mod
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

power = 1
NUM = 10 ** 9 + 7

for i in range(1, N + 1) :
    power *= i 
    if power >= NUM :
        power %= NUM
print(power)
"""
power = math.factorial(N)

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

Submission status: Accepted

Solution code:
import math

N = int(input())

power = math.factorial(N)

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

Submission status: Accepted

Solution code:
def INSTR():
	return input()

def INNUM():
	return int(INSTR())

def INSTR_S():
	return INSTR().split()

def INNUM_S():
	return map(int, INSTR_S())

def INSTR_M(n):
	return [INSTR() for _ in range(n)]

def INNUM_SM(n):
	return [tuple(INNUM_S()) for _ in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

import math

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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