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

# AtCoder Beginner Contest
# Problem B


if __name__ == '__main__':
    from math import factorial

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
# ABC 055 B

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

Submission status: Accepted

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

N = int(input())

result = 1
th = int(1e9 + 7)
for n in range(N, 0, -1):
    result = result * n
    if result >= th:
        result = result % th

print(result % th)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
if n == 1:
    print(1)
else:
    f = 1
    for i in range(1,n+1):
        f *= i
        f = f%1000000007
    print(f)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

now = 1
n = int(input())

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

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

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
MOD = 10**9 + 7

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

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

power = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(prod)

Submission status: Accepted

Solution code:
x = int(raw_input())
a = 1L
for i in range(1, x+1):
 a = a * i
 a = a % 1000000007
print(a)

Submission status: Accepted

Solution code:
num = int(input())

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

Submission status: Accepted

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

print(ans)

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

def solve(num):
    mod = int(1e9 + 7)
    ans = 1
    for i in range(1, num+1):
        ans *= i
        ans %= mod
    return ans

print solve(n)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial

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

Submission status: Accepted

Solution code:
import math

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

print(math.factorial(N) % C)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MOD = 1000000007
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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
mod = 1000000000 + 7

n = input()

ans = 1

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

print ans

Submission status: Accepted

Solution code:
N=int(input())

P=1

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

print(P)

Submission status: Accepted

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

print(power)

Submission status: Accepted

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


MOD = 1000000007

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

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

if __name__ == "__main__": 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:
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)%(1e9+7)
    

print(int(ans%(1e9+7)))

Submission status: Accepted

Solution code:
from collections import defaultdict

MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def imp_kai(n):
    ac = 1
    for i in range(n):
        ac *= i + 1
        ac = ac % (1e9 + 7)
    return ac % (1e9 + 7)

n = int(input())
print(int(imp_kai(n)))

Submission status: Accepted

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

import functools

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

mod_n = int(1e9) + 7
N = int(input())
print(math.factorial(N) % mod_n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):
    ans = 1 
    for i in range(n):
        ans = (i+1)*ans%(10**9+7)
        
            
    return ans

N = int(input())
print(solve(N))

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

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



print(power)

Submission status: Accepted

Solution code:
MOD=1000000007

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

print(power%1000000007)

Submission status: Accepted

Solution code:
# coding: utf-8

if __name__ == '__main__':
    n = int(input())
    p = 1
    for i in range(n):  #range(10) は [0,1,2,3,4,5,6,7,8,9] を表す
        p *= (i+1)
        p %= int(1e9 + 7)
    print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
n = input()

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

Submission status: Accepted

Solution code:
N = int(raw_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(N) :
    ans *= i+1
    ans %= mod
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(P)

Submission status: Accepted

Solution code:
n = int(input())

x = 7 + pow(10,9)
s = 1 % x

for i in range(n):
    s = s * (i+1) % x
    
print(s)

Submission status: Accepted

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

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

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

print(power)

Submission status: Accepted

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

import sys
import os


N = int(input())

D = 10**9 + 7

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

Submission status: Accepted

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

while n>1:
    ans =  ans * n % (10**9 + 7)
    n -= 1
print(ans)

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:
#! coding:UTF-8
N = int(input())
data = [0]*N
def tra(N):
    data[0] = 1
    for i in range(N-1):
        if (i+2)*data[i] < (10**9+7):
            data[i+1] = (i+2)*data[i]
        else:
            data[i+1] = (i+2)*data[i]%(10**9+7)
    print(data[-1])
tra(N)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

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

n = int(raw_input())

power = 1
m = 10**9 + 7

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

print(power)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
mod = 10**9 + 7
N = int(raw_input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


n = int(input())

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

Submission status: Accepted

Solution code:
from math import factorial

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 1
mod = 10**9 + 7

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
M = 1000000007
n=[1]*(N+1)
for i in range(1,N+1):
    n[i] = (n[i-1]*i)%M

print(n[N])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(150000)
mod = 1000000007
n = int(input())

def fact(n):
    if n <= 1:
        return 1
    else:
        return n * fact(n - 1) % mod

print(fact(n))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()


def main():
    n = II()
    r = 1
    for i in range(1,n+1):
        r = r*i % mod
    return r

print(main())

Submission status: Accepted

Solution code:
N = int(input())

res = 1

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

print(int(res))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import numpy as np
from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    bi_1 = 1L
    bi = bi_1
    z = (10**9L+7L)
    for i in range(1,N+1):
        bi = -z * int((bi_1 * i)/z) + bi_1 * i
        bi_1 = bi
    print bi

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
# sys.setrecursionlimit(10000)


def main():
    # 入力処理
    N = int(input())

    # アルゴリズム本体
    y = math.factorial(N) % (10**9+7)

    # 出力
    print(y)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n=int(raw_input().strip())

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

print power

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(1,N+1) :
        ans *= i
        # 剰余演算の分配則
        ans %= 1000000007
    ans %= 1000000007
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
if __name__ == '__main__':
  N = int(input())
  ans = 1
  for i in range(1,N+1):
    ans *= i
    ans %= 1000000007
  print(ans)

Submission status: Accepted

Solution code:
import sys
from math import factorial

MOD = 10**9 + 7

def solve():
    N = int(input())
    ans = factorial(N) % MOD
    print(ans)
    
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

MOD = 10**9 + 7

def solve():
    N = int(input())
    ans = 1

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

    print(ans)
    
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
multi = 1
N = int(raw_input())
for var in range(1,N + 1):
  multi = multi * var
  if multi > 1000000007:
    multi = multi % 1000000007
print multi

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:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
i = int(input())
#x, y = map(int, input().split())
power = 1
for i in range(1, i+1):
    power = (power*i) %(10**9+7)

print(power)

Submission status: Accepted

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

print(p)

Submission status: Accepted

Solution code:
n = int(raw_input())
c = 10**9 + 7
m = 1
for x in xrange(1, n+1):
    m=m*x
    if (m > c) : m = m % c

print m

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

Submission status: Accepted

Solution code:
n = int(raw_input())
r = 1.0
for i in range(1,n+1):
    r = r * i
    if r > 1.0e+9 + 7:
        r = (r % (1.0e+9+7))
        #r -= ri * (10.0e+9+7)

print str(int(r))

Submission status: Accepted

Solution code:
x = int(raw_input())
y = 1

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

print y

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

denom = 10**9+7

res = 1
for i in range(N):
    res = (res * (i+1)) % denom
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
N=int(input())
power=1

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

print(power)

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    n = int(input())
    result = 1
    for i in range(2, n+1):
        result *= i
        result %= 1000000007
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(p)

Submission status: Accepted

Solution code:
n = int(raw_input())


N = []
for i in range(1,n+1):
	N.append(i)

N2 = 1
for N1 in N:
	N2 = N2 * N1%(10**9+7)

print N2

Submission status: Accepted

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

Submission status: Accepted

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

import math

N = input()
power = 1
for i in range(N):
    power = math.fmod(power*(i+1),1000000007)

print(int(power))

Submission status: Accepted

Solution code:
import math
def input_parser():
    N=int(input())
    return N

N=input_parser()
power=1
rem_power=1
bignum=10**9+7
for i in range(0,N,1):
    rem_power=(rem_power*(i+1)) % bignum
rem=rem_power


# logpower = math.log(1,bignum)
#
# for i in range(0,N,1):
#     print("hoge")a
#     plus=math.log((i+1),bignum)
#     rem_plus=plus-math.floor(plus)
#     logpower = logpower + rem_plus
#     logpower = logpower - math.floor(logpower)
#
# rem = bignum ** logpower

def output_parser(output):
    print(output)

output_parser(round(rem))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def expand(n):
  result = 1
  for i in range(n):
    result = result*(i+1)%(1000000007)
  return result

print expand(input())

Submission status: Accepted

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

power = 1

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

print(power)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
XD = 1
for i in range(input()):
    XD = (XD * -~i) % (10**9+7)
print XD

Submission status: Accepted

Solution code:
from operator import mul
print reduce(lambda a,b:a*b%(10**9+7),range(1,int(raw_input())+1),1)

Submission status: Accepted

Solution code:
import math
 
n = int(raw_input())
mod = pow(10,9) + 7
ans = 1
for i in xrange(1,n+1):
  ans = (ans*i)%mod
 
print ans

Submission status: Accepted

Solution code:
n = int(input())


mod_num = pow(10, 9) + 7


def main(n):
    ret = 1
    for i in range(1, n + 1):
        ret = ret * i % mod_num
    return ret
    

answer = main(n)
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())

v = 10**9 + 7

t = 1
mod = []
for i in range(1,N+1):
    t = t * i
    if (t > v):
        mod.append(t % v)
        t = 1 #reset
mod.append(t % v)

#print mod

s = 1
for j in range(len(mod)):
    s = s * mod[j]

ans = s % v
print ans

Submission status: Accepted

Solution code:
#ABC055B
import math

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

Submission status: Accepted

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

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

total = 1

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

print (total)

Submission status: Accepted

Solution code:
print reduce(lambda a,x:a*(x+1)%(10**9+7),range(input()),1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import functools
print(functools.reduce(lambda x, y: x * y % (10**9+7), range(1,1+int(input()))))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
INF=10**10

def main():
    
    lim=10**9+7
    n=int(input())
    ans=1
    for i in range(1,n+1):
        ans*=i
        if ans>lim:
            ans%=lim
    print(ans)
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())


mod_num = pow(10, 9) + 7


def main(n):
    pre = 1
    for i in range(2, n + 1):
        pre = pre * i % mod_num
    return pre


ans = main(n)
print(ans)

Submission status: Accepted

Solution code:
MOD = 1000000007

n = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
N = int(raw_input())
MOD = 10 ** 9 + 7
p = 1
for i in xrange(2, N + 1):
    _, p = divmod(i * p, MOD)
print p

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

Submission status: Accepted

Solution code:
import sys
import math

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

power = math.factorial(n)

print(power % (int(1e+9) + 7))

Submission status: Accepted

Solution code:
from sys import stdin
ans = 1
mod = 10**9 + 7
n = int(stdin.readline())
for i in xrange(1,n+1):
 ans = (ans*i)%mod
print ans

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 整数の入力
N = int(input())
# 計算1
p = 1
temp = 10**9 + 7
 
for num in range(1,N+1):
    p = p * num
    if p > (10**9 + 7):
        p = p % temp
    
# 計算2
ans = p % temp
 
# 出力
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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