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: Time Limit Exceeded

Solution code:
n = int(input())

p = 1

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans = power % 1000000007
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
power = 1

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
rslt = 1
while n > 1:
    rslt *= n
    n -= 1
print(rslt%(10**9+7))

Submission status: Time Limit Exceeded

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

print(ans%a)

Submission status: Time Limit Exceeded

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

print(ans%a)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
li=list(map(int,range(1,N+1)))
#print(li)
ans=1
for i in range(N):
  #print(li[i])
  ans*=li[i]
print(ans%(10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

s = 1

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

devide = 10 ** 9 + 7

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

ans = power % devide
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

devide = 10 ** 9 + 7

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

print(power % devide)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans=1
while N>0:
  ans*=N
  N-=1
  
print(ans%DIV)

Submission status: Time Limit Exceeded

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 1

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

print(ans%1000000007)

Submission status: Time Limit Exceeded

Solution code:

line = int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

p = 1

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# ABC 055: B – Training Camp
from math import factorial

n = int(input())
power = 1

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

amari = (10 ** 9) + 7
print(int(power % amari))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def main():
    n = inp()
    res = 1
    for i in range(1,n+1):
        res *= i%mod
    print(res%mod) 
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

power = power % tmp
print(power)

Submission status: Time Limit Exceeded

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

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

print(power % tmp)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

power = 1
n = int(input())
tmp = 10 ** 9 + 7

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

print(power % tmp)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

ans = power % (pow(10, 9) + 7)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

Submission status: Time Limit Exceeded

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

n = int(input())

power = 1

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

i=1

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator
N = int(input())
prod = functools.partial(functools.reduce,operator.mul)
print(prod(list(range(1,N+1)))%(10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans_tmp = 1
for i in range(1, n + 1):
    ans_tmp *= i

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())


Power = 1

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

print(Power % (1000000000 + 7))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

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

Submission status: Time Limit Exceeded

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

if ans < 10**9+7:
    print(ans)
else:
    print(ans%(10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
res = 1
temp = 1

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

for i in range(9):
    temp = temp * 10
temp = temp + 7


print(res % temp)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
mod = 1000000007

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

Submission status: Time Limit Exceeded

Solution code:
n = input() # N times
n = int(n)

power = 1

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

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

Submission status: Time Limit Exceeded

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

print(res)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 1
mod = 10 ** 9 + 7

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

print(ans % mod)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

mod = 10 ** 9 + 7
ans = power % mod
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

a = pow(10, 9) + 7

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
n=int(input())
a=1
for i in range(1,n+1):
	a=a*i
	
print(a%1000000007)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import time

# N = int(input())


# start = time.time()
x = 1
# sum = 0

for i in range(int(input())):
  x = x * (i+1)
  # sum = x

# print(sum)

# elapsed_time = time.time() -start
# print(elapsed_time)



# start = time.time()
# a = 10
# n = 9
# b = a ** n 
print(x % (10**9 + 7))
# elapsed_time = time.time() -start
# print(elapsed_time)

# 2 3 4  5
# 2 6 24 120 
#   3 12 60

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

a = 10
n = 9
b = a ** n 
print(x % (b + 7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

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

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

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

N = int(input())

power = 1

for x in range(1, N + 1):
    power *= x

mod = 10 ** 9
mod += 7

answer = power % mod
print(answer)

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
def main(n):
    i = 1
    div = 10**9 + 7

    for c in range(1, n+1):
        i = i*c

    if i < div:
        return i
    else:
        return i % div


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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

rate=1

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


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

Submission status: Time Limit Exceeded

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

print(ans % MOD)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

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

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

p=1
mod=10**9+7

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

print(p%mod)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a=1

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

max_num = 10 ** 9 + 7

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

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

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

sunuke = 1

li = [i for i in range(1,n+1)]
for j in range(n):
    sunuke=sunuke*li[j]

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=1
for i in range(N):
  A *= (i+1)
 
# A = (1+N)/2 * N
# print(A)
A %=(10**9+7)
print('%d' %(A))

Submission status: Time Limit Exceeded

Solution code:

N=int(input())
A = 1
for i in range(N):
  A *= (i+1)

A %=(10**9+7)
print(A)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# Training CampTraining Camp
N = int(input())

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

p = float(p % (10**9 + 7))
print(int(p))

Submission status: Time Limit Exceeded

Solution code:
#ABC 55, B - training camp
n = int(input())
p = 1
for i in range(1, n+1):
    p *= i
print(p % (10**9 + 7))

Submission status: Time Limit Exceeded

Solution code:
import functools

def solve():
    n = read()
    result = think(n)
    write(result)


def read():
    return read_int(1)[0]


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n):
    p = 10 ** 9 + 7
    return mod_fact(n, p)


def mod_fact(n, p):
    sequence = [i + 1 for i in range(n)]
    return functools.reduce(lambda x, y: x * y, sequence) % p


def write(result):
   print(result)


if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans = power%BIGNUM
print(ans)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
MOD = 10**9 + 7

N = int(input())
num = 1

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

if num < (10**9 + 7):
  print(num)
else:
  print(num % (10**9 + 7))

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
p = list(range(1, n+1))
mod = (10 ** 9) + 7

x = 1

for i in p:
    x *= i

print(x%mod)

Submission status: Time Limit Exceeded

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

    power = 1

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

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


if __name__ == "__main__":

    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 1

for i in range(N):

    ans *= i+1

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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


abc()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

p = 1

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

p = 1

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

cnt = 1
for i in range(1,n+1):
    cnt *=i

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = 1

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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