Problem:


Score : 200 points

Problem Statement

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

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

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

Constraints

1 ≤ N ≤ 10^{5}

Input

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

N

Output

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

Sample Input 1

3

Sample Output 1

6

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

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

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

Sample Input 2

10

Sample Output 2

3628800

Sample Input 3

100000

Sample Output 3

457992974

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



Sample input:
3


Sample output:
6

Submission status: Accepted

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

Submission status: Accepted

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

#----------
N = int(input().strip())
#----------
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):
    i += 1
    p *= i
    p %= 10**9 + 7

print(p)

Submission status: Accepted

Solution code:
import math
N = int(input())
print(math.factorial(N)%int((1e9+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%1000000007)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 55

N = int(input())

mod = 1000000007

import math 
print(math.factorial(N) % mod)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:

N=int(input())
power=1
bignum=1000000007

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=10**9+7


a=int(input())
x=1
for i in range(1,a+1):
    x = x*i%X
print(x)

Submission status: Accepted

Solution code:
X=10**9+7

def A(c,d):
    return c*d%X

a=int(input())
x=1
for i in range(1,a+1):
    x = A(x,i)

print(x)

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 = (ans*i) % 1000000007
print(ans)

Submission status: Accepted

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

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%(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 sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
print(factorial(n) % mod)

Submission status: Accepted

Solution code:
import math
N = int(input())
N2=math.factorial(N)

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- 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:
import itertools
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())
mod = 1000000007
answer = 1
for x in range(n):
    answer *= x + 1
    answer %= mod
print(answer)

Submission status: Accepted

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

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

    return ans

def main():
    A = int(input())
    print(xy(A))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
def factorial(n):
    ans = 1
    for i in range(1,n+1):
        ans = ans * i % (10**9+7)
    return ans
print(factorial(n))

Submission status: Accepted

Solution code:
MOD=10**9+7
class Fp(int):
    def __new__(self,x=0):return super().__new__(self,x%MOD)
    def inv(self):return self.__class__(super().__pow__(MOD-2,MOD))
    def __add__(self,value):return self.__class__(super().__add__(value))
    def __sub__(self,value):return self.__class__(super().__sub__(value))
    def __mul__(self,value):return self.__class__(super().__mul__(value))
    def __floordiv__(self,value):return self.__class__(self*self.__class__(value).inv())
    def __pow__(self,value):return self.__class__(super().__pow__(value%(MOD-1), MOD))
    __radd__=__add__
    __rmul__=__mul__
    def __rsub__(self,value):return self.__class__(-super().__sub__(value))
    def __rfloordiv__(self,value):return self.__class__(self.inv()*value)
    def __iadd__(self,value):self=self+value;return self
    def __isub__(self,value):self=self-value;return self
    def __imul__(self,value):self=self*value;return self
    def __ifloordiv__(self,value):self=self//value;return self
    def __ipow__(self,value):self=self**value;return self
    def __neg__(self):return self.__class__(super().__neg__())


N = int(input())
ans = Fp(1)
for i in range(1, N+1):
    ans *= i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

mod = 10 ** 9 + 7

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

Submission status: Accepted

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

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

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
import math


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

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


if __name__ == '__main__':
    res = solve()
    print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n= int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
div_const = 1000000007

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

print(power)

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=1
    mod=10**9+7
    for i in range(1,n+1):
        ct=ct*i
        ct=ct%mod
    print(ct)
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(p)

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

'''
p,m=map(int,input().split())
s=bin(p)
s=s[2:]
n=len(s)


ans=pow(2,n) -1
if(m>=2):
    print(ans)
else:
    print(p)


m,n=map(int,input().split())
a=[False]*(n+1)
a[0]=True
for i in range(m):
    temp=list(map(int,input().split()))
    for kk in temp[1:]:
        a[kk]=True
ans=True
for nn in a:
    ans = nn and ans
if(ans):
    print("YES")
else:
    print("NO")



y,b,r = map(int,input().split())

if(r>b):
    if(b>y):
        print(int((3*y)+3))
    else:
        print(int(3*b))
else:
    if(b<y):
        print(int((3*y)-3))
    else:
        print()


  '''

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

# TLEとなってしまう
# modの世界を使う

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:


def main():
    # N! を　10^9+7 で割ったあまりを求めよ
    # N!そのものは非常に値が大きくなるから64bit符号付き整数ではオーバーフローによって正しく値が求めれない
    # 多倍長整数の乗算計算は時間が掛かって実行時間制限内に計算を終えることが難しくなる
    # x = i * mod 10^9 + 7として更新していけば64bit符合付整数で収まる

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




if __name__ == "__main__":
    main()

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:
import sys
input = sys.stdin.readline
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:
power=1
n=int(input())
mod=10**9+7
for i in range(1,n+1):
    power*=i
    power%=mod
    #print(power)
print(power)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

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

TrainingCamp()

Submission status: Accepted

Solution code:
N=int(input())
p = 1
C = 10**9+7

for i in range(N + 1):
  if i == 0:
    continue

  p *= i
  p %= C

print(p)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
mod = 7 + 10 ** 9
ans = 1
while N > 1:
    ans *= N
    ans %= mod
    N -= 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(x)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


import numpy as np
import math
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())
m=1
x=10**9+7
for i in range(1,n+1):
  m=m*i%x
  
print(m)

Submission status: Accepted

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

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

ans = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

mod_n = 10**9+7
ans = 1

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

# Nの階乗を計算する
def factorial(N):
    f = [1] * (N+1)
    mod = 10 ** 9 + 7
    for i in range(1, N+1):
        f[i] = i * f[i - 1] % mod
    return f[-1]


print(factorial(N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

mod = 10**9+7

s = 1

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

print(s)

Submission status: Accepted

Solution code:
i = int(input())
x = 1000000007
ans = 1

for j in range(1, i + 1):
    ans = ((ans * j) % x)
print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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 *= i
    power %= 1000000007

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
p=1
if n<=1000:
    for i in range(1,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)
else:
    p=641419708
    for i in range(1001,n+1):
        p*=i
        p=p%(10**9+7)
    print(p)

Submission status: Accepted

Solution code:
n = int(input())
#da = list(map(int,input().split()))
#a,b = map(int,input().split())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#N, M = map(int, input().split())
N = int(input())
#S = str(input())

p = (10 ** 9) + 7

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

Submission status: Accepted

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

def modmulti(a, b):
  return a * b % INF

for i in range(1, n+1):
  x = modmulti(x, i)

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

Submission status: Accepted

Solution code:
#55b
import math
N = int(input())
MODBY = 7 + 10**9

print(math.factorial(N)%MODBY)

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

ans = math.factorial(N) % 1000000007
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(answer)

Submission status: Accepted

Solution code:
from math import factorial

mod = 10**9 + 7
n = int(input())

ans = factorial(n) % mod
print(ans)

Submission status: Accepted

Solution code:

n = int(input())
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
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:
from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
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())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N=int(input().rstrip())
ans=1
inf=1000000000+7
for i in range(1,N+1,1):
    ans=(ans % inf) *(i % inf)
print(ans%inf)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

MOD = 10 ** 9 + 7
n = int(sys.stdin.readline().rstrip())

def main():
    res = 1
    for i in range(1, n+1):
        res *= i
        res %= MOD

    return res

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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


print(math.factorial(n) % m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
MOD = 10 ** 9 + 7

N = int(input())

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

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

print(a(n))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(p)