AtCoder Beginner Contest 055 - Training Camp

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

-----Sample Output-----
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.

Difficulty: EASY

Starter code:

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


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


n = int(input())
i = 1
j = 1
while j != n + 1:
	i = i * j % (10 ** 9 + 7)
	j += 1
print(i)


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


from math import gcd
from itertools import combinations, permutations, accumulate, product
from collections import deque, defaultdict, Counter
import decimal
import re
import math
import bisect
import heapq
import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
INF = float('inf')
from sys import stdin
readline = stdin.readline

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

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
n = I()
power = 1
for i in range(n):
	power = power * (i + 1) % mod
	power %= mod
print(power)


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


n = int(input())
d = 1
for i in range(n + 1)[1:]:
	d *= i
	d %= 10 ** 9 + 7
print(d)


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


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


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


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


import sys
from math import factorial
n = int(sys.stdin.readline())
print(factorial(n) % (10 ** 9 + 7))


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


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


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


from math import factorial
print(factorial(int(input())) % 1000000007)


import math

def answer(n: int) -> int:
	return math.factorial(n) % (10 ** 9 + 7)

def main():
	n = int(input())
	print(answer(n))

def __starting_point():
	main()
__starting_point()


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


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


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


import math
print(1 * math.factorial(int(input())) % 1000000007)


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


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


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


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


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


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


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


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


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


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


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


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


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


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


from math import factorial as fc
a = int(input())
print(fc(a) % (10 ** 9 + 7))


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


import sys
input = sys.stdin.readline

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

def __starting_point():
	main()
__starting_point()


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


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


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


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


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


from math import factorial
n = int(input())
print(factorial(n) % int(1000000000.0 + 7))


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


from functools import reduce
MOD = 1000000007
print(reduce(lambda a, b: a * b % MOD, list(range(1, int(input()) + 1))))


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


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


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


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


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


import math
N = int(input())
print(math.factorial(N) % int(1000000000.0 + 7))


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


import math
print(math.factorial(int(input().strip())) % 1000000007)


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


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


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


MOD = pow(10, 9) + 7

def MODINV(n: int, MOD=MOD):
	return pow(n, MOD - 2, MOD)

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

def __starting_point():
	main()
__starting_point()


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


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


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


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


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


import math
print(math.factorial(int(input())) % (1000000000 + 7))


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


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


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


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


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


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


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


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


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


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


import re
import copy

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


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


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


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


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


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


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


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


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


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


a = j = 1
for i in 'a' * int(input()):
	a *= j
	a %= 10 ** 9 + 7
	j += 1
print(a)


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


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


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


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


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


import math
N = int(input())
p = 1
for i in range(2, N + 1):
	p *= i
	p = p % (1000000000 + 7)
print(p)


import math
a = float(input())
print(math.factorial(a) % (10 ** 9 + 7))


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


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


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

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

def lint():
	return list(map(int, input().split()))

def lint_dec():
	return list(map(lambda x: int(x) - 1, input().split()))

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
N = ii()
ans = 1
for i in range(N):
	ans *= i + 1
	ans %= MOD
print(ans)


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
MOD = 10 ** 9 + 7

def solve():
	n = ini()
	p = 1
	for i in range(1, n + 1):
		p *= i
		p %= MOD
	return p
print(solve())


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


n = int(input())
p = 10 ** 9 + 7
ans = [1]
for i in range(1, n + 1):
	ans.append(ans[-1] * i % p)
print(ans[n])


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


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


N = int(input())
n = 1
while N != 1:
	n *= N
	n = n % (10 ** 9 + 7)
	N -= 1
print(n)


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


a = int(input())
b = 1
for i in range(1, a + 1):
	b = b * i
	if b > 1000000007:
		b = b % 1000000007
if b < 1000000000:
	print(b)
else:
	print(b % 1000000007)