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 .

Solution (Python):











mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline

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

Solution (Python):
N = int(input())
ret = 1
for i in range(2,N+1):
  ret *= i
  if 1000000007 <= ret:
    ret = ret%1000000007
print(ret)

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

Solution (Python):
n = int(input())

mod = 1000000007

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

print(p % mod)

Solution (Python):
n = int(input())

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

Solution (Python):
import math
def resolve():
    n = int(input())
    power = 1

    power = power * math.factorial(n)

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

if __name__ == '__main__':
    resolve()

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

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

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

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

Solution (Python):



from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe




def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(*args):
    print(*args,file=sys.stderr)

def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)

def pin(type=int):
    return map(type,input().split())
     


def resolve():
    N,=pin()
    ans=1
    
    mod=7+(pow(10,9))
    for i in range(1,N+1):
        ans*=i        
        ans%=mod
    print(ans)
    
        


"""


"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """3"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10"""
        output = """3628800"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """100000"""
        output = """457992974"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()

Solution (Python):


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

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

print(power)

Solution (Python):
N=int(input())
a=1
for b in range(a,N+1):
    a*=b
    if a>10**9+7:
        a=a%(10**9+7)
print(a)

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

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

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

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

Solution (Python):



N = int(input())


frac_num = 1
INF = 10**9 + 7

for i in range(1, N+1):
    frac_num = (frac_num * i) % INF

print(frac_num%INF)

Solution (Python):
def training(n):
    if n==1:
        return 1
    else:
        x=training(n-1)*n
        return x%mod
import sys
n=int(input())
sys.setrecursionlimit(10**9)
mod=10**9+7
print(training(n))

Solution (Python):
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()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10000000)

MOD = 1000000007  


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

    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
def pow(i,n):
  ret = 1
  if n == 0: return ret
  elif n & 1: return i*pow(i,n//2)**2
  else: return pow(i,n//2)**2
mod = 10**9 + 7
def fac(n):
  ans = 1
  for i in range(1,n+1):
    ans *= i
    ans %= mod
  return ans
n = int(input())
print(fac(n))

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

Solution (Python):


md = 1000000000 + 7

n = int(input().rstrip())

current = 1

for i in range(n):
    current *= (i+1)
    current = current % md

print(current)

Solution (Python):
import math

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

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

Solution (Python):
import sys

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

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


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

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

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

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

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

print(ans)

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

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

Solution (Python):

n = int(input())

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

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

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

Solution (Python):
from sys import stdin
def main():
	readline=stdin.readline
	N=int(readline())
	res=1
	mod=10**9+7
	for i in range(1,N+1):
		res*=i
		res%=mod
	print(res)
if __name__=="__main__":
	main()

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
mod = pow(10, 9) + 7
def factorial(n):
    return fact[n]

N = pow(10, 5)  
fact = [1, 1]  
factinv = [1, 1]  
inv = [0, 1]  

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    
    

n = int(input())
print(factorial(n))

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

ans %= mod
print(ans)

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

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

Solution (Python):
N = int(input())

MOD = 10**9 +7 

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

print(ans)

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

Solution (Python):
n = int(input())

ans = 1

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

Solution (Python):
n = int(input())

ans = 1

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

print(ans)

Solution (Python):
n = int(input())

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

print(k)

Solution (Python):
n = int(input())

MOD = 10 ** 9 + 7

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

print(p)

Solution (Python):
n = int(input())

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

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

Solution (Python):
n = int(input())
def factorial(n, mod = 10**9+7):
    tmp = 1
    for i in range(1, n+1):
        tmp = (tmp * i) % mod
    return tmp

def main():
    ans = factorial(n)
    print(ans)
    return

if __name__ == "__main__":
    main()

Solution (Python):

from functools import reduce
import sys

MOD = 1000000007  


def solve(N: int):
    print(reduce(lambda a, b: a * b % MOD, range(1, N + 1), 1))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
inf =1000000007

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

print(x)

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

Solution (Python):


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

Solution (Python):
import math;print((1*math.factorial(int(input())))%1000000007)

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

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

Solution (Python):
import math

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

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

Solution (Python):
n = int(input())

M = 10**9 + 7

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

print(power)

Solution (Python):

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

Solution (Python):
n = int(input())

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

print(tmp)

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

print(p)

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

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

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

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

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

print(ans)

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

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

Solution (Python):
N = int(input())

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

print(p)

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

Solution (Python):
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline())

mod = 10**9+7

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

print(ans)

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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
from functools import reduce 
def solve():
    mod = 10 ** 9 + 7
    N = int(input())
    print(reduce(lambda x,y: x*y%mod, list(range(1,N+1))))

if __name__ == '__main__':
    solve()

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    v = 10 ** 9 + 7
    ans = 1
    for x in range(2, N + 1):
        ans = (ans * x) % v
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import math
time = int(input())
p = math.factorial(time)
mod = p % (10**9+7)
print(mod)

Solution (Python):
import math
n = int(input())
MOD = (10 ** 9) + 7

print(math.factorial(n) % MOD)

Solution (Python):
N = int(input())

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

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

Solution (Python):


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

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

Solution (Python):
n = int(input())

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

Solution (Python):
N = int(input())

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline


def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        if fact > 10 ** 9 + 7:
            fact %= 10 ** 9 + 7
        fact *= integer

    return fact


n = int(input())

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

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

print(p)

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

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

Solution (Python):
import numpy as np
N = int(input())

power = 1
mod = 10 ** 9 + 7

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

print(power)

Solution (Python):
import numpy as np
N = int(input())

power = 1

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

print(power)

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

Solution (Python):



N = int(input().strip())

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

print( power )

Solution (Python):
N = int(input())

p = 1

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

print(p)

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

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

Solution (Python):
n = int(input())

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

print(a%1000000007)

Solution (Python):
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))

Solution (Python):
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()

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

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

Solution (Python):
N = int(input())

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

Solution (Python):


N = int(input())

mod = 1000000007

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

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

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

Solution (Python):
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))

Solution (Python):
n=int(input())

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

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

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

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

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

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

Solution (Python):
n = int(input())

ans = 1

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

Solution (Python):

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

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

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

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

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

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

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

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

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

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

print(ans)

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

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

Solution (Python):
X=10**9+7


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

Solution (Python):
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)

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

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

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

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

Solution (Python):
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))

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

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

Solution (Python):
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)

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

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

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

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

Solution (Python):


import math


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


if __name__ == "__main__":
    main()

Solution (Python):
import itertools
import math

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

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

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
mod = 1000000007
answer = 1
for x in range(n):
    answer *= x + 1
    answer %= mod
print(answer)

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

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

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

Solution (Python):
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()

Solution (Python):
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))

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

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

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

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

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

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

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

Solution (Python):

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

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

Solution (Python):
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)

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

Solution (Python):
"""
author : halo2halo
date : 31, Jan, 2020
"""

import sys




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)

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

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

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

Solution (Python):
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)

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

Solution (Python):
import math

N = int(input())

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

print(ans)

Solution (Python):
import math


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

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


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

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

Solution (Python):
n= int(input())

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

Solution (Python):
n = int(input())

ans = 1

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

print(ans)

Solution (Python):
import math

n = int(input())

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

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

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

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

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

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

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

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

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

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

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

print(power)

Solution (Python):
import math

n = int(input())

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

Solution (Python):
import math

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

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

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

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

Solution (Python):

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

Solution (Python):
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()

Solution (Python):
n = int(input())

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

print(ans)

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

Solution (Python):
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()

Solution (Python):
import math

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

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

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

Solution (Python):
import math

n = int(input())

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

Solution (Python):
n = int(input())

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

print(p)