CodeEff/ECCO huggingface dataset:
# Original solution
from sys import stdin, setrecursionlimit
from collections import defaultdict
from math import gcd

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


MOD = 1000000007
N = int(eval(input()))

d = defaultdict(int)
zeros = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if a == 0 and b == 0:
        zeros += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0:
            a *= -1
            b *= -1
        if a == 0 and b == -1:
            b = 1
        d[(a, b)] += 1

ans = 1
free = 0
for (a, b), n in list(d.items()):
    if b > 0:
        if (b, -a) in d:
            m = d[(b, -a)]
            ans = ans * (pow(2, n, MOD) + pow(2, m, MOD) - 1) % MOD
        else:
            free += n
    else:
        if (-b, a) not in d:
            free += n

ans = (ans * pow(2, free, MOD) + zeros - 1) % MOD
print(ans)


# Optimized solution
from sys import stdin, setrecursionlimit
from collections import defaultdict
from math import gcd

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


MOD = 1000000007
N, *AB = list(map(int, stdin.buffer.read().split()))

d = defaultdict(int)
zeros = 0
for a, b in zip(*[iter(AB)] * 2):
    if a == 0 and b == 0:
        zeros += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0:
            a *= -1
            b *= -1
        if a == 0 and b == -1:
            b = 1
        d[(a, b)] += 1

ans = 1
free = 0
for (a, b), n in list(d.items()):
    if b > 0:
        if (b, -a) in d:
            m = d[(b, -a)]
            ans = ans * (pow(2, n, MOD) + pow(2, m, MOD) - 1) % MOD
        else:
            free += n
    else:
        if (-b, a) not in d:
            free += n

ans = (ans * pow(2, free, MOD) + zeros - 1) % MOD
print(ans)
# Original solution
import collections
n=int(eval(input()))
A=[]
AA=[]
B=[]
C=[]
X=[]
mod=10**9+7
p=12231472983974394769
for i in range(n):
  a,b=list(map(int,input().split()))
  if a<0:
    a=a*-1
    b=b*-1
  if a*b>0:
    A.append(b*pow(a,p-2,p)%p)
  elif a*b<0:
    AA.append(a*pow((-b),p-2,p)%p)
  else:
    if a==0 and b==0:
      X.append(i)
    elif a==0:
      B.append(i)
    else:
      C.append(i)
D=collections.Counter(A)
DD=collections.Counter(AA)
E=set(list(D)+list(DD))
a=1
for i in E:
  a=(a*(2**D[i]+2**DD[i]-1))%mod
a=(a*(2**len(B)+2**len(C)-1)-1)%mod
print(((a+len(X))%mod))

# Optimized solution
import collections
n=int(eval(input()))
A=[]
AA=[]
B=[]
C=[]
X=[]
mod=10**9+7
p=137053438808121949
for i in range(n):
  a,b=list(map(int,input().split()))
  if a<0:
    a=a*-1
    b=b*-1
  if a*b>0:
    A.append(b*pow(a,p-2,p)%p)
  elif a*b<0:
    AA.append(a*pow((-b),p-2,p)%p)
  else:
    if a==0 and b==0:
      X.append(i)
    elif a==0:
      B.append(i)
    else:
      C.append(i)
D=collections.Counter(A)
DD=collections.Counter(AA)
E=set(list(D)+list(DD))
a=1
for i in E:
  a=(a*(2**D[i]+2**DD[i]-1))%mod
a=(a*(2**len(B)+2**len(C)-1)-1)%mod
print(((a+len(X))%mod))
# Original solution
import collections
n=int(eval(input()))
A=[]
AA=[]
B=[]
C=[]
X=[]
mod=10**9+7
p=137053438808121949
for i in range(n):
  a,b=list(map(int,input().split()))
  if a<0:
    a=a*-1
    b=b*-1
  if a*b>0:
    A.append(b*pow(a,p-2,p)%p)
  elif a*b<0:
    AA.append(a*pow((-b),p-2,p)%p)
  else:
    if a==0 and b==0:
      X.append(i)
    elif a==0:
      B.append(i)
    else:
      C.append(i)
D=collections.Counter(A)
DD=collections.Counter(AA)
E=set(list(D)+list(DD))
a=1
for i in E:
  a=(a*(2**D[i]+2**DD[i]-1))%mod
a=(a*(2**len(B)+2**len(C)-1)-1)%mod
print(((a+len(X))%mod))

# Optimized solution
from math import gcd
from collections import defaultdict
n=int(eval(input()))
A=defaultdict(int)
AA=defaultdict(int)
B=[]
C=[]
X=[]
mod=10**9+7
for i in range(n):
  a,b=list(map(int,input().split()))
  if a<0:
    a=a*-1
    b=b*-1
  if a*b>0:
    l=a*b//gcd(a,b)
    A[str(l//b)+":"+str(l//a)]+=1
  elif a*b<0:
    l=a*(-b)//gcd(a,-b)
    AA[str(l//a)+":"+str(l//(-b))]+=1
  else:
    if a==0 and b==0:
      X.append(i)
    elif a==0:
      B.append(i)
    else:
      C.append(i)
E=set(list(A.keys())+list(AA.keys()))
a=1
for i in E:
  a=(a*(2**A[i]+2**AA[i]-1))%mod
a=(a*(2**len(B)+2**len(C)-1)-1)%mod
print(((a+len(X))%mod))
# Original solution
import sys
input = sys.stdin.readline
import collections
import fractions
from fractions import Fraction
from collections import defaultdict
import math

n=int(eval(input()))
a= [list(map(int, input().split())) for i in range(n)]
b=defaultdict(int)
c=defaultdict(int)
b0=0
c0=0
mod=1000000007
ans=1
cnt=0
for i,j in a:
    if i!=0 and j!=0:
        x=i
        y=j
        i //= math.gcd(x, y)
        j //= math.gcd(x, y)
        b[Fraction(i,j)]+=1
        c[Fraction(j,i)]+=1
    elif i==0 and j!=0:
        b0+=1
    elif i!=0 and j==0:
        c0+=1
    else:
        cnt+=1
w=[]
if c0!=0 or b0!=0:
    ans*=pow(2,c0+b0)-((pow(2,c0,mod)-1)*(pow(2,b0,mod)-1))


for k,v in list(b.items()):
    if c[-k]!=0:
        ans*=(pow(2,c[-k]+v,mod)-(pow(2,c[-k],mod)-1)*(pow(2,v,mod)-1))
        w.append((pow(2,c[-k]+v,mod)-(pow(2,c[-k],mod)-1)*(pow(2,v,mod)-1)))
        ans%=mod
    else:
        ans*=pow(2,v,mod)
        ans%=mod

w=collections.Counter(w)
w=list(w.most_common())

for i,j in w:
    for k in range(j//2):
        ans*=pow(i,mod-2,mod)
ans+=cnt-1
print((int(ans%mod)))

# Optimized solution
import sys
input = sys.stdin.readline
import collections
import fractions
from collections import defaultdict
import math

n=int(eval(input()))
a= [list(map(int, input().split())) for i in range(n)]
b=defaultdict(int)
c=defaultdict(int)
b0=0
c0=0
mod=1000000007
ans=1
cnt=0
for i,j in a:
    if i!=0 and j!=0:
        x=i
        y=j
        i //= math.gcd(x, y)
        j //= math.gcd(x, y)
        i=abs(i)
        j=abs(j)
        if x*y>0:
            b[(i,j,0)]+=1
            c[(j,i,1)]+=1
        else:
            b[(i,j,1)]+=1
            c[(j,i,0)]+=1

    elif i==0 and j!=0:
        b0+=1
    elif i!=0 and j==0:
        c0+=1
    else:
        cnt+=1
w=[]
if c0!=0 or b0!=0:
    ans*=pow(2,c0+b0)-((pow(2,c0,mod)-1)*(pow(2,b0,mod)-1))

for k,v in list(b.items()):
    if c[k]!=0:
        ans*=(pow(2,c[k]+v,mod)-(pow(2,c[k],mod)-1)*(pow(2,v,mod)-1))
        w.append((pow(2,c[k]+v,mod)-(pow(2,c[k],mod)-1)*(pow(2,v,mod)-1)))
        ans%=mod
    else:
        ans*=pow(2,v,mod)
        ans%=mod

w=collections.Counter(w)
w=list(w.most_common())
for i,j in w:
    for k in range(j//2):
        ans*=pow(i,mod-2,mod)
ans+=cnt-1
print((int(ans%mod)))
# Original solution
n = int(eval(input()))

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

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


# Optimized solution
n = int(eval(input()))

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

# ans = ans % (10 ** 9 + 7)
print(ans)
# Original solution
N=int(eval(input()))
P=1
for i in range (N):
	P*=i+1
P=P%(10**9+7)
print(P)

# Optimized solution
N=int(eval(input()))
P=1
for i in range (N):
	P*=i+1
	P=P%(10**9+7)
print(P)
# Original solution
N=int(eval(input()))
a = 1

while N!=0:
  a = N*a
  N =N-1
print((a%(10**9+7)))
  
  

# Optimized solution
import math
N=int(eval(input()))
print((math.factorial(N)%(10**9+7)))
# Original solution
n = int(eval(input()))

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

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

# Optimized solution
n = int(eval(input()))

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

print(ans)
# Original solution
n = int(eval(input()))

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

# Optimized solution
n = int(eval(input()))

mod = 10 **9 +7
ans = 1
for i in range(1, n+1):
    ans *= i
    ans = ans % mod
print(ans)
# Original solution
num = int(eval(input()))
input = 1
for i in range(1, num+1):
    input *= i

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

# Optimized solution
import math



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

print((input % (10**9 + 7)))
# Original solution
import math

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

print((math.factorial(N) % C))

# Optimized solution
N = int(eval(input()))
C = 10**9+7
ans = 1
for i in range(1, N + 1):
    ans *= i
    ans %= C
print(ans)
# Original solution
n = int(eval(input()))
mod = pow(10, 9) + 7
import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)
l = [i for i in range(1, n+1)]
print((prod(l)%mod))

# Optimized solution
n = int(eval(input()))
mod = pow(10, 9) + 7
ans = 1
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)
# Original solution
N=int(eval(input()))
p=1
for i in range(N):
  p=p*(i+1)
print((p%1000000007))

# Optimized solution
N=int(eval(input()))
p=1
for i in range(N):
  p=p*(i+1)%1000000007
print(p)
# Original solution
n = int(eval(input()))
pow = 1
for i in range(n):
  pow *= i+1
print((pow%(10**9+7)))

# Optimized solution
n = int(eval(input()))
pow = 1
for i in range(n):
  pow *= i+1
  pow = pow%(10**9+7)
print(pow)
# Original solution
n=int(eval(input()))
num = 1
div=int(1e9)+7
for i in range(1,n+1):
  num *= i
print((num%div))

# Optimized solution
n=int(eval(input()))
num = 1
div=int(1e9)+7
for i in range(1,n+1):
  num = num*i%div
print(num)
# Original solution
n=int(eval(input()))
count=1
for i in range(1,n+1):
  count*=i
print((count%(10**9+7)))



# Optimized solution
n=int(eval(input()))
count=1
for i in range(1,n+1):
  count*=i
  count%=(10**9+7)
print(count)
# Original solution
#ABC055.B
N = int(eval(input()))
cnt = 1

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

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

# Optimized solution
#ABC055.B
import math
N = int(eval(input()))
ans = math.factorial(N)%(10**9+7)
print(ans)
# Original solution
N = int(eval(input()))
result = 1
TEISU = 10 **9 + 7
for i in range(N):
    result *= (i + 1)
if result > TEISU:
    print((result % TEISU))
else:
    print(result)


# Optimized solution
N = int(eval(input()))
result = 1
TEISU = 10 **9 + 7

for i in range(N):
    result = (i + 1) * result % TEISU
print(result)
# Original solution
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())

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

answer = power % MOD
print(answer)

# Optimized solution
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)
# Original solution
import math
x = int(eval(input()))
print((math.factorial(x) % (10**9 + 7)))

# Optimized solution
M = 1000000007
n=int(eval(input()))
f = 1
for i in range(1, n + 1):  
    f = (f * i) % M 
print(f)
# Original solution
n=int(eval(input()))
m=1
for i in range(1,n+1):
  m*=i
print((m%1000000007))


# Optimized solution
import math
n = int(eval(input()))
print((math.factorial(n) % (10**9+7)))
# Original solution
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return list(map(int,input().split()))
def lmp(): return list(map(int,input().split()))

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

# Optimized solution
import math
n=int(eval(input()))
print((math.factorial(n)%1000000007))
# Original solution
n = int(eval(input()))

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


# Optimized solution
import math
n = int(eval(input()))
print((math.factorial(n)%(10**9+7)))
# Original solution
N = int(eval(input()))
power = 1
for x in range(1, N+1):
    power *= x
print((power%(10**9+7)))

# Optimized solution
N = int(eval(input()))
power = 1
for x in range(1, N+1):
    power = (power * x) % (10**9+7)
print(power)
# Original solution
N = int(eval(input()))
MOD = 10 ** 9 + 7
ans = 1
for i in range(1, N + 1):
  ans *= i

print((ans % MOD))

# Optimized solution
N = int(eval(input()))
MOD = 10 ** 9 + 7
ans = 1
for i in range(1, N + 1):
  ans *= i
  ans %= MOD

print(ans)
# Original solution
N=int(eval(input()))

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

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

# Optimized solution
N=int(eval(input()))

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

print(res)
# Original solution
N=int(eval(input()))

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


ans=power%(1000000000+7)
print(ans)

# Optimized solution
import math
N=int(eval(input()))

power=math.factorial(N)

ans=power%(1000000000+7)
print(ans)
# Original solution
num = int(eval(input()))
result = 1
for i in range(1,num+1):
    result = result *i
print((result % 1000000007))

# Optimized solution
import math
print((math.factorial(int(eval(input())))%1000000007))
# Original solution
import math
print((math.factorial(int(eval(input())))%1000000007))

# Optimized solution
num = int(eval(input()))
result = 1
for i in range(1,num+1):
    result = result *i % 1000000007
print(result)
# Original solution
N = int(input())

pw = 1

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

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


# Optimized solution
N = int(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 #reset
mod.append(t % v)

#print mod

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

ans = s % v
print(ans)
# Original solution
N = int(eval(input()))
power = 1

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

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

# Optimized solution
N = int(eval(input()))
power = 1

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

print(power)
# Original solution
a=int(eval(input()))
b = 1
for i in range(1,a+1):
    b *= i
print((b%1000000007))

# Optimized solution
from math import factorial
print((factorial(int(eval(input())))%(10**9+7)))
# Original solution
n=int(eval(input()))
ans=1
for i in range(n):
  ans*=i+1
print((int(ans%(10**9+7))))

# Optimized solution
n=int(eval(input()))
ans=1
for i in range(n):
  ans*=i+1
  ans%=10**9+7
print(ans)
# Original solution
# -*- coding utf-8 -*-
import functools
import operator

n=int(eval(input()))
lst=list(range(1,n+1,1))

result = functools.reduce(operator.mul, lst)

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


# Optimized solution
# -*- coding utf-8 -*-
n=int(eval(input()))
ans=1

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

print(ans)
# Original solution
# -*- coding utf-8 -*-
n=int(eval(input()))
x=1

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

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


# Optimized solution
# -*- coding utf-8 -*-
n=int(eval(input()))
x=1

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


print(x)
# Original solution
import sys
def input(): return sys.stdin.readline().strip()

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

# Optimized solution
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    answer=1
    n=int(eval(input()))
    for i in range(1,n+1):
        answer*=i
        answer%=10**9+7
    print(answer)
resolve()
# Original solution
n = int(eval(input()))
p = 1
for i in range(1,n+1):
  p = p*i
ap = p%1000000007
print(ap)


# Optimized solution
n = int(eval(input()))
import math
p = math.factorial(n)
ap = p%1000000007
print(ap)
# Original solution
p = 1
for i in range(int(eval(input()))):
    p = p * (i+1)
print((p%((10**9)+7)))

# Optimized solution
p = 1
for i in range(int(eval(input()))):
    p = p * (i+1)
    p = p%((10**9)+7)
print(p)
# Original solution
n = int(eval(input()))
p=1
for i in range(1,n+1):
  p *=i
print((p%((10**9) + 7)))

# Optimized solution
n = int(eval(input()))
p=1
def cal(a,b):
  return a*b%1000000007

for i in range(1,n+1):
  p = cal(p,i)
  
print(p)
# Original solution
# coding: utf-8
ans = 1
for i in range(1, int(eval(input()))+1):
    ans *= i
    ans %= (10**9 + 7)
print(ans)

# Optimized solution
# coding: utf-8
ans = 1
n_mod = 10**9 + 7
for i in range(1, int(eval(input()))+1):
    ans = (ans * i) % n_mod
print(ans)
# Original solution
n=int(eval(input()))
mod=10**9+7
power=1
for i in range(1,n+1):
  power=power*i
print((power%mod))

# Optimized solution
n=int(eval(input()))
mod=10**9+7
power=1
for i in range(1,n+1):
  power=power*i%mod
print(power)
# Original solution
n = int(eval(input()))
p = 1
wari = 10**9+7
for i in range( 1,n + 1):
	p  *= i
print((str(p%wari)))

# Optimized solution
n = int(eval(input()))
p = 1
wari = 10**9+7
for i in range( 1,n + 1):
	p  = (p*i)%wari
print((str(p%wari)))
# Original solution
N=int(eval(input()))
ans = 1
for i in range(1,N+1):
    ans *= i
print((ans%(10**9+7)))

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

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

print((ans % mod))


# Optimized solution
import math

N = int(eval(input()))
mod = 10 ** 9 + 7
print((math.factorial(N) % mod))
# Original solution
n = int(eval(input()))
training = 1
for i in range(1, n + 1):
    training *= i
print((training % (10 ** 9 + 7)))


# Optimized solution
n = int(eval(input()))
training = 1
for i in range(1, n + 1):
    training = i * training % (10 ** 9 + 7)
print(training)
# Original solution
n=int(eval(input()))

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

# Optimized solution
n=int(eval(input()))

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

print(x)
# Original solution
n = int(eval(input()))
rslt = 1
while n > 0:
    rslt *= n
    n -= 1
print((rslt%(10**9+7)))

# Optimized solution
import math
n = int(eval(input()))
print(( math.factorial(n)%(10**9+7) ))
# Original solution
n = int(eval(input()))
ans = 1
for i in range(1, n+1):
  ans *= i
print((ans%(10**9+7)))

# Optimized solution
n = int(eval(input()))
ans = 1

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

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

# Optimized solution
n = int(eval(input()))
p = 1
for i in range(1,n+1):
	p *= i
	p = p % (10**9+7)
print(p)
# Original solution
import math
n = int(eval(input()))
print((math.factorial(n)%(10**9+7)))


# Optimized solution
n = int(eval(input()))
pw = 1
for i in range(n):
  pw *= (i+1)
  pw %= 10**9+7
print(pw)
# Original solution
N = int(eval(input()))
power = 1

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

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

# Optimized solution
N = int(eval(input()))
power = 1

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

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

# Optimized solution
n=int(eval(input()))
ans = 1
for i in range(2,n+1):
  ans = ans*i%(10**9+7)
print((ans%(10**9+7)))
# Original solution
n = int(eval(input()))
power = 1
for i in range(1,n+1):
    power *= i
print((power%(10**9 + 7)))

# Optimized solution
n = int(eval(input()))
power = 1
for i in range(1,n+1):
    power=power*i%(10**9+7)
print(power)
# Original solution
n = int(eval(input()))
p = 1
for i in range(1,n+1):
    p*=i

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


# Optimized solution
n = int(eval(input()))
ans = 1
for i in range(1,n+1):
    ans=ans*i%(1e9+7)

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

# Optimized solution
n= int(eval(input()))
cnt = 1
for i in range(1,n+1):
  cnt *= i
  cnt %= (10**9+7)
print(cnt)
# Original solution
n = int(eval(input()))
ans = 1

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

# Optimized solution
n = int(eval(input()))
ans = 1

while n>1:
    ans =  ans * n % (10**9 + 7)
    n -= 1
print(ans)
# Original solution
n = eval(input()) # N times
n = int(n)

power = 1

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

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

# Optimized solution
n = int(eval(input()))

power = 1

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

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

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

# Optimized solution
ans=1
n=int(eval(input()))
for i in range(1,n+1):
    ans=i*ans%(10**9+7)
print(ans)
# Original solution
n = int(eval(input()))
power = 1

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

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

# Optimized solution
n = int(eval(input()))
power = 1

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

print(power)
# Original solution
n=int(eval(input()))
ans=1

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

# Optimized solution
n=int(eval(input()))
ans=1

for i in range(1,n+1):
  ans*=i
  ans=ans%(10**9+7)
print(ans)
# Original solution
import math
x = int(eval(input()))
print((math.factorial(x) % (10**9 + 7)))

# Optimized solution
n = int(eval(input()))
fact = 1
for i in range(1,n+1):
  fact = fact * i % (10**9 +7)
res = fact % (10**9 + 7)
print(res)
# Original solution
n = int(eval(input()))
fact = 1
for i in range(1,n+1):
  fact = fact * i % (10**9 +7)
res = fact % (10**9 + 7)
print(res)

# Optimized solution
n = int(eval(input()))
ans=1
for i in range(1,n+1):
       ans=(ans*i)%1000000007

print(ans)
# Original solution
import math

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

# Optimized solution
n = int(eval(input()))

mod_n = 10**9+7
ans = 1

for i in range(1, n+1):
  ans = ans*i%mod_n
  
print(ans)
# Original solution
n = int(eval(input()))
p = 1
for i in range(1, n+1):
    p = p * i
print((p % 1000000007))

# Optimized solution
n = int(eval(input()))
p = 1
for i in range(1, n+1):
    p = p * i
    p = p % 1000000007
print(p)
# Original solution
N = int(eval(input()))

power = 1
#power = float(power)

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

power = power % (1000000000+7)
print(power)


# Optimized solution
N = int(eval(input()))
power = 1
for i in range(N):
    power = (i+1) * (power % 1000000007)

print((power%1000000007))
# Original solution
N=int(eval(input()))
num=1
for i in range(1,N+1):
    num*=i
print((num%(10**9+7)))

# Optimized solution
import math
print((math.factorial(int(eval(input())))%(10**9+7)))
# Original solution
#!/usr/bin/python

import math
import sys

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

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

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

# Optimized solution
#!/usr/bin/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 range(50001, n + 1):
                answer = (answer * i) % (10**9 + 7)
        print(answer % (10**9 + 7))

if __name__ == "__main__":
    main(sys.argv)
# Original solution
n = int(eval(input()))
a = 1
for i in range(1,n+1):
    a = i*a
a = a%(10**9+7)
print(a)

# Optimized solution
import math
n = int(eval(input()))
a = math.factorial(n)
print((a%(10**9+7)))
# Original solution
n = int(eval(input()))
power = 1
for i in range(1, n+1):
    power = power * i
answer = power % (10 ** 9 + 7)
print(answer)

# Optimized solution
n = int(eval(input()))
power = 1
for i in range(1, n+1):
    power = power * i % (10 ** 9 + 7)
print(power)
# Original solution
N = int(eval(input()))
p = 1
for i in range(1, N + 1):
    p *= i
print((p % 1000000007))


# Optimized solution
import math
N = int(eval(input()))
print((math.factorial(N) % 1000000007))
# Original solution

n = int(eval(input()))
power = 1

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

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


# Optimized solution

n = int(eval(input()))
ans = 1

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

print(ans)
# Original solution
N=int(eval(input()))
t=1
for i in range(1,N+1):
    t*=i

print((int(t%(10**9+7))))


# Optimized solution
import math
N=int(eval(input()))

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