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
A = 10**9 + 7

  #yをxで割った時の商をa、余りをbとすると、y=ax+b
  #ここにiを掛けると、y=(ax+b)i
  #y=aix+bi、となるので第１項は余りが０になる
  #なので、毎回割って、その余りにのみ注目すれば良い

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

print(power)

Submission status: Accepted

Solution code:

"""
N=int(input())

print(800*N-int(N/15)*200)
"""
"""
N=int(input())
S=input()

max_n=0
temp=0
for strng in S:
	if strng=="I":
		temp+=1
		if max_n<temp:
			max_n=temp
	else:
		temp-=1
print(max_n)
"""
N=int(input())

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

Submission status: Accepted

Solution code:
import sys

M = 10**9 + 7
N = int(sys.stdin.readline().strip())

x = 1

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

print(x)

Submission status: Accepted

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

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

print(Sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
ans = 1
n_mod = pow(10,9) + 7
for i in range(1, int(input())+1):
    ans = (ans * i) % n_mod
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
ans = 1
n_mod = 10**9 + 7
for i in range(1, int(input())+1):
    ans = (ans * i) % n_mod
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
ans = 1
for i in range(1, int(input())+1):
    ans *= i
    ans %= (10**9 + 7)
print(ans)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

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

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
a = int(input())
pow = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
MOD = int(1e9)+7
power = 1

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

Submission status: Accepted

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

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


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

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

    print(p)

main()

Submission status: Accepted

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

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

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

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial
n = int(input())
print(factorial(n)%1000000007)

Submission status: Accepted

Solution code:
## ABC 055B

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n=int(input())

res=1
bn=10**9+7

for i in range(1,n+1):
  res=int((res*i)%bn)
print(res)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(p%1000000007)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MOD = 10**9+7

def power_up(n):
    result = 1
    for i in range(2,n+1):
        result = result*i%MOD
    return result

n = int(input())
print(power_up(n)%MOD)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> int:
    n = next_int()
    m = 10 ** 9 + 7

    ans = 1

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

    print(ans)
    return 0


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for n in range(1,N+1):
    a *= n
    if a/m >= 1:
        a -= int(a/m)*m

print(a)

Submission status: Accepted

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

print(sunuke)

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

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

Submission status: Accepted

Solution code:
MOD =10**9 + 7

def factorial(n):
    result = 1

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mod = 1000000007

n = int(input())
factorial_previous = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n < 5000:
    power=1
    index=2
    while index < n+1:
        power*=index
        index+=1
elif n == 5000:
    power = 541108809 + (10**9 + 7)*2
elif n > 5000 and n < 40000:
    power = 541108809
    index = 5001
    while index < n+1:
        power*=index
        index+=1
elif n == 40000:
    power = 422550956 + (10**9 + 7)*2
elif n > 40000 and n < 70000:
    power = 422550956
    index = 40001
    while index < n+1:
        power *= index
        index += 1
elif n == 70000:
    power = 296716438 + (10**9 + 7)*2
else:
    power = 296716438
    index= 70001
    while index < n+1:
        power *= index
        index += 1

if power > 10**9 + 7:
    print(power%(10**9 + 7))
else:
    print(power)

Submission status: Accepted

Solution code:
n = int(input())
ans = 1
i = 1
while i<=n:
  ans = ans*i%(1000000007)
  i += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

power = 1

p = 1000000000 + 7

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

n = int(input());
x = 1 
for i in range(1, n + 1):
	x = (x * i) % (1000000000 + 7)
print (x)

Submission status: Accepted

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

ans = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
def fact(n):
     table=[1]*n
     for i in range(1,n):
         table[i]=table[i-1]*(i+1) % (10**9+7)
     return table
print(fact(N)[N-1]% (10**9+7))

Submission status: Accepted

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

print(num)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

n = ni()
MOD = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

power=math.factorial(N)

ans=power%(1000000000+7)
print(ans)

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

N = int(input())

power = math.factorial(N)

print(power % 1000000007)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
MOD = int(1e9 + 7)

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#55b
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())

i = 1
power = 1
while i <= n:
    if power >= 10**9 + 7:
        power %= (10**9 + 7)
    power *= i
    i += 1
print(power % (10**9 + 7))

Submission status: Accepted

Solution code:
N = int(input())

k = 1000000007

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

print(math.factorial(n)%1000000007)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mod=1000000007

def P(x):
    ans=1
    for i in range(x):
        ans=ans*(i+1)%mod
    
    return(ans)

n=int(input())

print(P(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

power = math.factorial(n)

mod = 10**9+7

print(power % mod)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

Solution code:

def main():
    n = int(input())
    ans = 1

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

    print(ans)

if __name__ == "__main__":
        main()

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

result = 1
mod = 10**9+7

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

print(result)

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) 

# 大き過ぎる値を調整する
# ans = ans % (10 ** 9 + 7) 

print(ans)

Submission status: Accepted

Solution code:
number = int(input())

power = 1

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    n = int(sys.stdin.readline())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

a = [1]
for i in range(1, n+1):
    a.append(i*a[i-1] % (10**9+7))

print(a[n])

Submission status: Accepted

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

def mul(a, b):
  return ((a % m) * (b % m)) % m

a=1
for i in range(1,n+1):
  a=mul(a,i)
print(a)

Submission status: Accepted

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

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

print(powar)

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

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

print(n)

Submission status: Accepted

Solution code:
import numpy
import re
import math

def main():
	"""
	テストコード実行
	:return:
	"""
	print(math.factorial(int(input())) % (10**9 + 7))

if __name__ == '__main__':
	main()

Submission status: Accepted

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

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import factorial
n = int(input())
print(factorial(n)%int(1e9+7))

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(N):
    power = power*(i+1)
    if power >= 10**5:
        power = power%(10**9+7)

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

Submission status: Accepted

Solution code:
import math
def getinputdata():

    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

power = 1

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

Submission status: Accepted

Solution code:
N=int(input())
P=1
ans=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

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

Submission status: Accepted

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

n = int(input())

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

print(power)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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())
divisor = int(1e9) + 7

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

print(power)

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

Submission status: Accepted

Solution code:
mod = 1000000007

N = int(input())

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

Submission status: Accepted

Solution code:
N = -1

def _input():
    global N
    N = int(input())

def solve():
    _input()
    snuke_power = 1
    for i in range(1, N+1):
        snuke_power *= i
        snuke_power %= (10 ** 9 + 7)
    print(snuke_power)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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