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

now = 1
n = int(input())

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

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

print(ans%mod)

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

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

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math
N = int(input())
p = math.factorial(N)
print(p % 1000000007)

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

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


if __name__ == "__main__":
    main()

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

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

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

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

print(power)

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

power = 1

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

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

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

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

print(prod)

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

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

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

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

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

Solution (Python):
x = int(raw_input())
a = 1L
for i in range(1, x+1):
 a = a * i
 a = a % 1000000007
print(a)

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

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

print(prod)

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

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

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

print(ans)

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

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

Solution (Python):
n = input()

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

print solve(n)

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

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

print(ans)

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

Solution (Python):
from math import factorial

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

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

Solution (Python):
import math

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

print(math.factorial(N) % C)

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

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

Solution (Python):
mod = 1000000000 + 7

n = input()

ans = 1

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

print ans

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

Solution (Python):
import math

N = int(input())

power = math.factorial(N)

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

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

print(power)

Solution (Python):




MOD = 1000000007

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

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

if __name__ == "__main__": main()

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

for i in range(n):
    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)%(1e9+7)
    

print(int(ans%(1e9+7)))

Solution (Python):
from collections import defaultdict

MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Solution (Python):
def imp_kai(n):
    ac = 1
    for i in range(n):
        ac *= i + 1
        ac = ac % (1e9 + 7)
    return ac % (1e9 + 7)

n = int(input())
print(int(imp_kai(n)))

Solution (Python):
n = int(input())
M = 10**9 + 7

import functools

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

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

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

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

Solution (Python):


import sys
import subprocess
import json
import time
import math
import re
import sqlite3

mod_n = int(1e9) + 7
N = int(input())
print(math.factorial(N) % mod_n)

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

Solution (Python):
def solve(n):
    ans = 1 
    for i in range(n):
        ans = (i+1)*ans%(10**9+7)
        
            
    return ans

N = int(input())
print(solve(N))

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

result = 1

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

print(result)

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

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



print(power)

Solution (Python):
MOD=1000000007

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

if __name__ == "__main__":
    solve()

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

print(power%1000000007)

Solution (Python):


if __name__ == '__main__':
    n = int(input())
    p = 1
    for i in range(n):  
        p *= (i+1)
        p %= int(1e9 + 7)
    print(p)

Solution (Python):
N = int(raw_input())
d = 10**9 + 7
pw = 1
for n in range(1,N+1) :
  pw = (pw * n) % d
print pw

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

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

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

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

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

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

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

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

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

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

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

x = 7 + pow(10,9)
s = 1 % x

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

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

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

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

print(a)

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

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

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

print(power)

Solution (Python):


import sys
import os


N = int(input())

D = 10**9 + 7

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

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

while n>1:
    ans =  ans * n % (10**9 + 7)
    n -= 1
print(ans)

Solution (Python):

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())
data = [0]*N
def tra(N):
    data[0] = 1
    for i in range(N-1):
        if (i+2)*data[i] < (10**9+7):
            data[i+1] = (i+2)*data[i]
        else:
            data[i+1] = (i+2)*data[i]%(10**9+7)
    print(data[-1])
tra(N)

Solution (Python):
import math

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

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

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


power = 1

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

print(power)

Solution (Python):


n = int(raw_input())

power = 1
m = 10**9 + 7

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

print(power)

Solution (Python):

mod = 10**9 + 7
N = int(raw_input())

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

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

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

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

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

Solution (Python):




n = int(input())

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

Solution (Python):
from math import factorial

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

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):
from math import factorial
N = int(input())
P = factorial(N)
print(P%(10**9+7))

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

print(n[N])

Solution (Python):
import sys
sys.setrecursionlimit(150000)
mod = 1000000007
n = int(input())

def fact(n):
    if n <= 1:
        return 1
    else:
        return n * fact(n - 1) % mod

print(fact(n))

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

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

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

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

Solution (Python):

n = int(input())

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()


def main():
    n = II()
    r = 1
    for i in range(1,n+1):
        r = r*i % mod
    return r

print(main())

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

res = 1

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

print(int(res))

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np
from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    bi_1 = 1L
    bi = bi_1
    z = (10**9L+7L)
    for i in range(1,N+1):
        bi = -z * int((bi_1 * i)/z) + bi_1 * i
        bi_1 = bi
    print bi

if __name__ == '__main__':
    main()

Solution (Python):

import sys
import math



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

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

    
    print(y)


if __name__ == '__main__':
    main()

Solution (Python):


n=int(raw_input().strip())

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

print power

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

Solution (Python):

import math

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

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(1,N+1) :
        ans *= i
        
        ans %= 1000000007
    ans %= 1000000007
    print(ans)

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

Solution (Python):

if __name__ == '__main__':
  N = int(input())
  ans = 1
  for i in range(1,N+1):
    ans *= i
    ans %= 1000000007
  print(ans)

Solution (Python):
import sys
from math import factorial

MOD = 10**9 + 7

def solve():
    N = int(input())
    ans = factorial(N) % MOD
    print(ans)
    
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None


if __name__ == '__main__':
    solve()

Solution (Python):
import sys

MOD = 10**9 + 7

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

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

    print(ans)
    
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None


if __name__ == '__main__':
    solve()

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

Solution (Python):
multi = 1
N = int(raw_input())
for var in range(1,N + 1):
  multi = multi * var
  if multi > 1000000007:
    multi = multi % 1000000007
print multi

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

Solution (Python):


i = int(input())

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

print(power)

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(raw_input())
c = 10**9 + 7
m = 1
for x in xrange(1, n+1):
    m=m*x
    if (m > c) : m = m % c

print m

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

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

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

print(ans)

Solution (Python):

N = int(input())
p = 1

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

print(p)

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(raw_input())
r = 1.0
for i in range(1,n+1):
    r = r * i
    if r > 1.0e+9 + 7:
        r = (r % (1.0e+9+7))
        

print str(int(r))

Solution (Python):
x = int(raw_input())
y = 1

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

print y

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

print(ans)

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

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

denom = 10**9+7

res = 1
for i in range(N):
    res = (res * (i+1)) % denom
print(res)

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

Solution (Python):


N=int(input())
power=1

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

print(power)

Solution (Python):



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

if __name__ == '__main__':
    main()

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

print(p)

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


N = []
for i in range(1,n+1):
	N.append(i)

N2 = 1
for N1 in N:
	N2 = N2 * N1%(10**9+7)

print N2

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

Solution (Python):


import math

N = input()
power = 1
for i in range(N):
    power = math.fmod(power*(i+1),1000000007)

print(int(power))

Solution (Python):
import math
def input_parser():
    N=int(input())
    return N

N=input_parser()
power=1
rem_power=1
bignum=10**9+7
for i in range(0,N,1):
    rem_power=(rem_power*(i+1)) % bignum
rem=rem_power













def output_parser(output):
    print(output)

output_parser(round(rem))

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

Solution (Python):
def expand(n):
  result = 1
  for i in range(n):
    result = result*(i+1)%(1000000007)
  return result

print expand(input())

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

power = 1

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

print(power)

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

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

print(ans)

Solution (Python):
XD = 1
for i in range(input()):
    XD = (XD * -~i) % (10**9+7)
print XD

Solution (Python):
from operator import mul
print reduce(lambda a,b:a*b%(10**9+7),range(1,int(raw_input())+1),1)

Solution (Python):
import math
 
n = int(raw_input())
mod = pow(10,9) + 7
ans = 1
for i in xrange(1,n+1):
  ans = (ans*i)%mod
 
print ans

Solution (Python):
import math
 
n = int(raw_input())
mod = pow(10,9) + 7
ans = 1
for i in xrange(1,n+1):
  ans = (ans*i)%mod
 
print ans

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


mod_num = pow(10, 9) + 7


def main(n):
    ret = 1
    for i in range(1, n + 1):
        ret = ret * i % mod_num
    return ret
    

answer = main(n)
print(answer)

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

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

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

v = 10**9 + 7

t = 1
mod = []
for i in range(1,N+1):
    t = t * i
    if (t > v):
        mod.append(t % v)
        t = 1 
mod.append(t % v)



s = 1
for j in range(len(mod)):
    s = s * mod[j]

ans = s % v
print ans

Solution (Python):

import math

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

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

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

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

print(power)

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

total = 1

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

print (total)

Solution (Python):
print reduce(lambda a,x:a*(x+1)%(10**9+7),range(input()),1)

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

Solution (Python):
import functools
print(functools.reduce(lambda x, y: x * y % (10**9+7), range(1,1+int(input()))))

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

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

Solution (Python):

INF=10**10

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

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


mod_num = pow(10, 9) + 7


def main(n):
    pre = 1
    for i in range(2, n + 1):
        pre = pre * i % mod_num
    return pre


ans = main(n)
print(ans)

Solution (Python):
MOD = 1000000007

n = int(input())

ans = 1

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

print(ans)

Solution (Python):
N = int(raw_input())
MOD = 10 ** 9 + 7
p = 1
for i in xrange(2, N + 1):
    _, p = divmod(i * p, MOD)
print p

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

print(ans)

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

Solution (Python):
import sys
import math

n = int(sys.stdin.readline())

power = math.factorial(n)

print(power % (int(1e+9) + 7))

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

Solution (Python):
from sys import stdin
ans = 1
mod = 10**9 + 7
n = int(stdin.readline())
for i in xrange(1,n+1):
 ans = (ans*i)%mod
print ans

Solution (Python):
N=input()
 
r=1
for i in xrange(N):
    r=r*(i+1)
    r=r%(10**9 + 7)
 
print r

Solution (Python):
n = input()
n = int(n)
M = 10 ** 9 + 7

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

Solution (Python):
from collections import defaultdict
MOD = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())

p = 1
temp = 10**9 + 7
 
for num in range(1,N+1):
    p = p * num
    if p > (10**9 + 7):
        p = p % temp
    

ans = p % temp
 

print(ans)

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

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

Solution (Python):
cn = 10**9+7
def f(x, n):
    for i in range(n):
        x = (x*n)%cn
        n-=1
    return x

n = int(input())
pw = f(1, n)
print(pw)

Solution (Python):
import math

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

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

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

Solution (Python):


import math
import sys

def main(argv):
    for line in sys.stdin:
        n = int(line)

        answer = 737935835
        if n < 50000:
            answer = math.factorial(n)
        elif n > 50000:
            for i in xrange(50001, n + 1):
                answer = (answer * i) % (10**9 + 7)
        print answer % (10**9 + 7)

if __name__ == "__main__":
    main(sys.argv)

Solution (Python):
import math

def countPower():
    power = 1
    N = int(input())
    if 1<=N<=10**5:
        power = math.factorial(N)
    return power % (10**9 + 7)

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

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

tmp=1
for i in range(1,N+1):
    tmp = (tmp*i)%inf
print(tmp)

Solution (Python):

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

print(str(a))

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

Solution (Python):
n = int(input())
div = 10 ** 9 + 7

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

print(ans)

Solution (Python):

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

Solution (Python):
import math

N = int(input())

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

print(ans)

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

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

print(ans)

Solution (Python):
import math
N = int(input())
pwr = math.factorial(N)
print(str(pwr % 1000000007))

Solution (Python):
import sys
N = int(raw_input())
assert(1 <= N <= 1e5)

res = 1
mult = 1
for i in xrange(N):
    res *= mult
    res = res%(1e9 + 7)
    mult += 1
print int(res)

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

d = 10 ** 9 + 7

if N <= 50000:
    P= 1
    for x in range(1, N+1):
        P *= x
elif N > 50000:
    P = 737935835
    for x in range(50001, N + 1):
        P *= x
    
print(P%d)

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

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

pwr=math.factorial(N)

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

Solution (Python):
import math
N=int(input())
X=math.factorial(N)
Y=X%(1000000007)
print(Y)

Solution (Python):
N = int(input())
start = 1
for i in range(1, N + 1):
    start *= i
    if start > 1E9 + 7:
        start = int(start % (1E9 + 7))
print(start)

Solution (Python):
import math

def range_prod(lo,hi):
    if lo+1 < hi:
        mid = (hi+lo)//2
        return range_prod(lo,mid) * range_prod(mid+1,hi)
    if lo == hi:
        return lo
    return lo*hi

def treefactorial(n):
    if n < 2:
        return 1
    return range_prod(1,n)
n = int(input())
m = 10**9+7
print(treefactorial(n%m)%m)

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

Solution (Python):
import math



num = int(input())
input = math.factorial(num)

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

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

Solution (Python):

from math import factorial
print(factorial(int(input()))%(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())

p = 1
div = 10 ** 9 + 7

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

print(p)

Solution (Python):
def factorialMod(n, modulus):
    ans=1
    if n <= modulus//2:
        
        for i in range(1,n+1):
            ans = (ans * i) % modulus
    else:
        
        for i in range(n+1,modulus):
            ans = (ans * i) % modulus
        ans = modinv(ans, modulus)
        ans = -1*ans + modulus
    return ans % modulus


print factorialMod(input(),10**9+7)

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

Solution (Python):

def getLnInputs():
    return input().split()


def getLnIntInputs():
    return list(map(int, getLnInputs()))


def main():
    N = getLnIntInputs()[0]
    power = 1
    for i in range(1, N + 1):
        power *= i
        power %= 1000000007

    print(power)
    return


main()

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

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

Solution (Python):
n = int(raw_input())
ans = 1
for x in xrange(1,n+1):
	ans*=x;
	ans%=(10**9+7)
print ans%(10**9+7)

Solution (Python):
from sys import stdin
from math import factorial

n = int(stdin.readline())

print(factorial(n) % 1000000007)

Solution (Python):

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

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

Solution (Python):
def calc(n):
    ret = 1
    for i in range(1,n+1):
        ret *= i
        ret = ret % (10**9+7)
    return ret

print(calc(int(input()))%(10**9+7))

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

ans = 1

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

print(ans)

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

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

print(Ans)

Solution (Python):
from  math import factorial

n = int(input())

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

Solution (Python):
from collections import defaultdict


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