Problem:


Score : 200 points

Problem Statement

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

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

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

Constraints

1 ≤ N ≤ 10^{5}

Input

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

N

Output

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

Sample Input 1

3

Sample Output 1

6

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

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

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

Sample Input 2

10

Sample Output 2

3628800

Sample Input 3

100000

Sample Output 3

457992974

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



Sample input:
3


Sample output:
6

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
p=1
def cal(a,b):
  return a*b%1000000007

for i in range(1,n+1):
  p = cal(p,i)
  
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

r = 1

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def factorial(n, mod):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
        fact %= mod
    return fact

N = int(input())
mod = 10 ** 9 + 7
print(factorial(N, mod))

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
num = int(input())
result = math.factorial(num) % (10 ** 9 + 7)
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

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

print(a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(power)

Submission status: Accepted

Solution code:
import numpy as np
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(1,n+1):
    ans*=i
    ans %=(10**9+7)
    
print(ans)

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

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

print(x)

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


if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
from math import factorial
def myAnswer(N:int) ->int:
   ans =factorial(N)
   return ans % (10**9 + 7)

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   print(myAnswer(N))


if __name__ == '__main__':
   main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
_input = int(input())

power = 1

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

power %= 1000000007

print(power)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import functools

N = int(input())
print(functools.reduce(lambda x, y: x * y % 1000000007, range(1, N+1)))

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    n=int(input())
    mod=10**9+7
    p=1
    for ni in range(n):
        p=p*(ni+1)%mod
    print(p)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
mod = 1000000007
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:
N = int(input())
mod = 10**9+7
p = 1

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    from functools import reduce

    MOD = 10 ** 9 + 7

    def mod_mul(a, b):
        return a * b % MOD

    N = int(input())
    ans = reduce(mod_mul, range(1, N + 1))
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d,mod=[1]+[0]*100100,10**9+7
for i in range(1,10**5+1):d[i]=d[i-1]*i%mod
print(d[int(input())])

Submission status: Accepted

Solution code:
import numpy as np
mod=10**9+7
d=np.zeros(100100,dtype=np.int64)
d[0]=1
for i in range(1,10**5+1):
  d[i]=d[i-1]*i%mod
print(d[int(input())])

Submission status: Accepted

Solution code:
from collections import defaultdict
dp=defaultdict(int)
mod=10**9+7
dp[0]=1
for i in range(1,10**5+10):
  dp[i]=dp[i-1]*i%mod
  
print(dp[int(input())])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(power)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(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 *= i
    power %= MOD
print(power)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

j = 1

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

print(j)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
MOD = 10**9 + 7


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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
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 debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(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()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

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

Submission status: Accepted

Solution code:
import math
def main():
    N = int(input())
    power = math.factorial(N)
    print(power%(1000000000 + 7))
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
print(cal(N))

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(power)

Submission status: Accepted

Solution code:
import math

N = int(input())
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

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

ans=1

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

P = 10 ** 9 + 7


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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(res % M)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

MOD = 10 ** 9 + 7

N = int(readline().rstrip())

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

answer = answer % MOD
print(answer)

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

Submission status: Accepted

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

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

print(N % mod)

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

v = 1
for i in range(n):
  v = v*(i+1)
  if v >= 1e9+7:
    v = v%(int(1e9)+7)
  
print(v)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 055: B – Training Camp
n = int(input())

m = 10 ** 9 + 7
power = 1

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

print(power)

Submission status: Accepted

Solution code:
n=int(input())

p=1

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

print(p)

Submission status: Accepted

Solution code:
n = int(input())

pw = 1

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

Submission status: Accepted

Solution code:
n = int(input())

MOD = 1000000000 + 7
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

pw = 1

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

Submission status: Accepted

Solution code:
import math

n = int(input())

ans = 1
if n > 1:
    ans = math.factorial(n) % (10**9 + 7)

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
#import itertools
#import statistics
#import numpy as np
#import collections
n = int(input())
#k, s = list(map(int, input().split()))
#a = list(map(int, input().split()))
print(math.factorial(n)%(pow(10, 9)+7))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

l = 10**9 + 7
power = 1

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

print(power)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def factorial_power(n):
    power = 1
    
    for i in range(1, n+1):
        power *= i
        power = power % divisor
    return power

divisor = (10 ** 9) + 7

N = int(input())

print(factorial_power(N))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

power = math.factorial(N)
result = power % (pow(10, 9) + 7)
print(result)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
MOD = 10**9 + 7
tmp = 1
for i in range(1, N+1):
    tmp *= i
    if tmp>=MOD:
        tmp %= MOD
print(tmp)

Submission status: Accepted

Solution code:
mod = 1000000007

n=int(input())

ans = 1

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


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

Submission status: Accepted

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
mod = 10**9+7



def main():
  n = int(input())
  ans = 1
  for _ in range(2,n+1):
    ans *= _
    ans %= mod
  print(ans%mod)
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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("{}".format(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())
a = 1
for i in range(1,n+1):
    a = i * a % (10**9+7)

print(a)

Submission status: Accepted

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

pw = 1

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

print(pw)

Submission status: Accepted

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

Submission status: Accepted

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

amari = 1

for i in range(1,N+1):
    amari = amari * i%waru
    if amari > waru:
        amari = amari % waru
        
print(amari)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
INF = 1000000007
n = int(input())

ans = 1


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# B - Training Camp
# モジュールのインポート
import math

# 標準入力の取得
N = int(input())

# N回目のトレーニングを終えるとパワーはN!になる
print(math.factorial(N)%(pow(10,9)+7))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(power)

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

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())
c=1
for i in range(N):
  c *= i+1
  c = c % (10**9+7) # ここで、掛け算のスケールを減らすのか！

print(c)