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

Submission status: Accepted

Solution code:
power = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
Mod = 10**9 + 7
ans = 1  # パワー

for i in range(1, N + 1):
    ans = (ans * i) % Mod  # 途中計算ごとに%をとってよい
    # ans *= i % (10**9 + 7) としてはいけない
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
# Mod = 10**9 + 7
ans = 1  # パワー

for i in range(1, N + 1):
    ans = ans * i % (10**9 + 7)  # 途中計算ごとに%をとってよい
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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


print(power_level)

Submission status: Accepted

Solution code:
N = int(input())

power = 1
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
N = int(input())

power = 1
mod = 10 ** 9 + 7

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N =int(input())

w = (10**9)+ 7
ans =1
for i in range(1,N+1):
    ans *= i
    if ans >=w:
        ans%=w
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:
#055 B
N = int(input())
ans =1
w = pow(10,9) + 7
for i in range(1,N+1):
    ans *= i
    if ans >=w:
        ans %=w
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 1
w = pow(10,9) + 7

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
MOD = 10 ** 9 + 7

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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


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

    p = 1

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

    print(p)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    n = II()
    ans = n * 800
    print(ans-(n//15)*200)
    return

#B
def B():
    n = II()
    print(math.factorial(n)%mod)
    return

#C
def C():

    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    n = I()
    print(n*800-200*(n//15))

#B
def B():
    k = I()
    ans = 0
    for i in range(1,k):
        for j in range(i+1,k+1):
            if (i%2)^(j%2):
                ans += 1
    print(ans)

#C
def C():
    x,t = LI()
    print(max(0,x-t))

#D
def D():
    n = I()
    ans = 1
    for i in range(1,n+1):
        ans *= i
        ans %= mod
    print(ans)

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

def J():
    return

def K():
    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

mod = 10 ** 9 + 7

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

print(power)

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

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

print(ans)

Submission status: Accepted

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

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

print(int(rem))

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:
ans=1
for i in range(int(input())):
    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:
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:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
# -*- coding: utf-8 -*-


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r] % self.mod
        return ret


N = int(input())
F = FactMod(N+1, 10**9+7)
print(F.fact(N))

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:
import math 
n = int(input())
print(math.factorial(n)%1000000007)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Mar  8 01:35:11 2019

@author: yuta
"""
import math

N = int(input())

def main(n):
    x = math.factorial(n)
    max_value = pow(10,9) + 7
    print(x % max_value)

main(N)

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 sys

def main():
	n = int(input())
	
	p = 1
	for i in range(1, n+1):
		p = (p * i) % 1000000007
		
	print(p)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

INF=1e18
MOD=1e9+7

N=int(input())

ans=1

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


n = ip()                              #入力整数1つ
#n,m= (int(i) for i in input().split())      #入力整数横2つ
#w,a,b = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
s = 1
for i in range(1,n+1):
    s*=i
    s%=(pow(10,9)+7)
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
""" AtCoder """

N = int(input())

t = 1000000000 + 7

ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def fun():
     print('ac')
     print('ac')
     print('ac')
     print('ac')
from math import*
n=eval(input())
n=factorial(n)%(10**9+7)
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INF = 1000000007


def modmulti(a, b):
    # aとbを掛けた値をmodする(a * b mod p)
    return a * b % INF


N = int(input())

ans = 1

for i in range(1, N + 1):
    ans = modmulti(ans, i)

print(ans)

Submission status: Accepted

Solution code:
INF = 1000000007


def modmulti(a, b):
    # aとbを掛けた値をmodする(a * b mod p)
    res = 0
    mod = a % INF
    while b > 0:
        if b & 1 == 1:
            res += mod
            if res > INF:
                res -= INF
        mod <<= 1
        if mod > INF:
            mod -= INF
        b >>= 1
    return res


N = int(input())

ans = 1

for i in range(1, N + 1):
    ans = modmulti(ans, i)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

mod = 10 ** 9 + 7
ans = 1

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

print(ans)

Submission status: Accepted

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

result = math.factorial(N)

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

Submission status: Accepted

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

pow = 1
for i in range(1, n+1):
  pow *= i
  pow %= d
print(pow)

Submission status: Accepted

Solution code:
from math import factorial;print(factorial(int(input()))%(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:
import math
print((math.factorial(int(input())))%(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 = ans*i%MOD
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

print(ans)

Submission status: Accepted

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

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

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print(result)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import sys

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_n = int(input())

power = 1

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

print(power)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import math
f = math.factorial(int(input()))
q = 10**9+7
k = f % q
print(k)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 1
while(n>0):
    ans*=n
    ans = ans%(1000000000+7)
    n -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

answer=1
n=N

while(1):
    if n==1:
        break
    answer*=n
    answer%=10**9+7
    n=n-1


print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def an(a):
    z=1
    for i in range(2,a+1):
        z=z*i%(10**9+7)
    return z
print(an(int(input())))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    """Function."""
    n = int(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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