Harryxun/stf_run huggingface dataset:
import sympy
N = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


L1 = factorization(N - 1)
s = 1
# print(L1)
for [a, b] in L1:
    s *= (b + 1)
# print(s)
# print(set(sympy.divisors(N))-{1})
for i in set(sympy.divisors(N))-{1}:
    temp = N
    while temp % i == 0:
        temp //= i
    if (temp-1) % i == 0:
        s += 1
s -= 1
print(s)


### FIXED CODE ###

N = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


L1 = factorization(N - 1)
s = 1
# print(L1)
for [a, b] in L1:
    s *= (b + 1)
# print(s)


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


for i in set(make_divisors(N))-{1}:
    temp = N
    while temp % i == 0:
        temp //= i
    if (temp-1) % i == 0:
        s += 1
s -= 1
if N == 2:
    print(1)
else:
    print(s)
# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)
import sys
sys.setrecursionlimit(10 ** 9)


def main():
    N, A = tuple(map(int, input().rstrip().split()))
    X = tuple(map(int, input().rstrip().split()))
    x = max(X)
    # dp[i][j][k] := patterns to make k by j cards from X1, X2, ..., Xi
    dp = [[[0] * (N * x + 1) for _ in range(N + 1)] for _ in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(N):
        for j in range(N):
            for k in range(N * x + 1):
                if dp[i][j][k]:
                    dp[i + 1][j][k] += dp[i][j][k]
                    dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]
    ans = sum(dp[N][i][i * A] for i in range(1, N + 1))
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC044C - 高橋君とカード / Tak and Cards (ARC060C)
def main():
    N, A = tuple(map(int, input().rstrip().split()))
    X = tuple(map(int, input().rstrip().split()))
    x = max(X)
    # dp[i][j][k] := patterns to make k by j cards from X1, X2, ..., Xi
    dp = [[[0] * (N * 50 + 1) for _ in range(N + 1)] for _ in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(N):
        for j in range(N):
            for k in range(N * 50 + 1):
                if dp[i][j][k]:
                    dp[i + 1][j][k] += dp[i][j][k]
                    dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]
    ans = sum(dp[N][i][i * A] for i in range(1, N + 1))
    print(ans)


if __name__ == "__main__":
    main()
A，B，C = list(map(str, input().split()))
vincent = [A,B,C]
vincent1 = list(set(vincent))
if len(vincent1) == 2:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

A, B, C = list(map(int, input().split()))
vincent = [A,B,C]
vincent1 = list(set(vincent))
if len(vincent1) == 2:
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
  a, b = map(lambda x:int(x)-1, input().split())
  graph[a] += [b]
  graph[b] += [a]
dist = [float('inf')]*N

def dfs(u, pre, cnt):
  dist[u] = cnt
  for v in graph[u]:
    if v != pre and cnt+1 < dist[v]:
      dfs(v, u, cnt+1)

    
dfs(0, -1, 0)
if 0 < dist[N-1] <= 2:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

from collections import defaultdict
n, m = map(int, input().split())
bridges = [list(map(int, input().split())) for _ in range(m)]
first_bridge = []
second_bridge = []
bri_dict = defaultdict(list)
for bridge in bridges:
  bri_dict[bridge[0]].append(bridge[1])
  bri_dict[bridge[1]].append(bridge[0])
for bridge in bridges:
  if bridge[1] == n:
    second_bridge.append(bridge[0])

flag = False
for island in second_bridge:
  if 1 in bri_dict[island]:
    flag = True
  
if flag:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
# セグメント木。区間における要素の取得をO(logN)で行うことが可能である。
class SegTree():
    def __init__(self, lists, function, basement):
        self.n = len(lists)
        self.K = (self.n-1).bit_length()
        self.func = function
        self.basement = basement
        self.seg = [basement]*2**(self.K+1)

        for i in range(self.n):
            self.seg[i+2**self.K-1] = lists[i]

        for i in range(2**(self.K)-2, -1, -1):
            self.seg[i] = self.func(self.seg[2*i+1], self.seg[2*i+2])

    def update(self, k, value):
        # 0-indexでa[k]の値をvalueに変更
        k += 2**self.K-1
        self.seg[k] = value
        while k:
            k = (k-1)//2
            self.seg[k] = self.func(self.seg[k*2+1], self.seg[k*2+2])

    def query(self, p, q):
        # 0-indexで[p,q)の値を取得する
        if q <= p:
            return self.basement
        num = 2**self.K
        p += num-1
        q += num-2
        res = self.basement
        while q-p > 1:
            if p & 1 == 0:
                res = self.func(res, self.seg[p])
            if q & 1 == 1:
                res = self.func(res, self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.func(res, self.seg[p])
        else:
            res = self.func(self.func(res, self.seg[p]), self.seg[q])
        return res


#gcd on blackboard
#セグ木（区間gcd) verify
from math import gcd
N=int(input())
A=list(map(int,input().split()))
seg=SegTree(A,gcd,0)
ans=1
for i in range(-1,N):
    v=gcd(seg.query(0,i),seg.query(i+1,N))
    ans=max(v,ans)
print(ans)


### FIXED CODE ###

#プログラムの例:
n=int(input())
listsT=list(map(int,input().split()))
from fractions import gcd
lists_left=[]
lists_right=[]
number1=0
number2=0
for i in range(n):
    if i==0:
        lists_left.append(0)
    if i==1:
        lists_left.append(listsT[0])
        number1=listsT[0]
    if i>=2:
        number1=gcd(number1,listsT[i-1])
        lists_left.append(number1)

number2=listsT[-1]
for j in range(n,0,-1):
    if j==n:
        lists_right.append(0)
    if j==n-1:
        lists_right.append(listsT[-1])
    if j<n-1:      
        number2=gcd(number2,listsT[j])  
        lists_right.append(number2)
ans=0
for x in range(n):
    if ans<= gcd(lists_right[x],lists_left[n-1-x]):
        ans=gcd(lists_right[x],lists_left[n-1-x])   
print(ans)
#６回目、2020-0612
#2重ループ + numpy
#場合分けを近道と通常のみ（絶対値を使う）
import numpy as np 
#初期入力
N, x, y = map(int, input().split())
dist =np.zeros((N,N),dtype=int)

#iからjの距離
for i in range(1,N):
    j =np.arange(i+1,N+1)
    normal =j -i
    short  =abs(x-i) +1 +abs(j-y)
    dist[i-1,i:] =np.minimum(normal,short)
    #print(d)
#距離別の数
a,ans =np.unique(dist,return_counts=True)      
ans =np.delete(ans,0) #距離０を削除
count_zero =N-1-len(ans) 
ans =np.append(ans,np.zeros(count_zero))#存在しない遠い距離は０

#出力
for i in ans:
    print(int(i))

### FIXED CODE ###

N, X, Y = map(int, input().split())
D = [None] + [0] * (N - 1) #最低距離が1からNまでの個数を表示するリストを作る(YZT さんのコメント)

#各最低距離の個数カウント
for i in range(1, N):                           # i 出発
    for j in range(i + 1, N + 1):               # j 到着
        d = min(abs(j - i),                     # 近道をしない
                abs(X - i) + 1 + abs(j - Y),    # 「+1」は近道の距離、X < Y　
                abs(Y - i) + 1 + abs(j - X))    # 「+1」は近道の距離、Y < X　
        D[d] += 1                               # 距離ｄごとにカウント
        # print(abs(j-i),abs(X-i)+1 , abs(j-Y) , abs(Y - i) + 1,abs(j - X)," ",d,D," ",i,j)
    
for d in D[1:]: #最低距離は１だから距離０は使わないが、添え字＝距離とすることでわかりやすい
    print(d)
k,x=input().split()
if 500 * k >= x:
  print("Yes")
  return
else:
  print("No")


### FIXED CODE ###

k,x=(int(x) for x in input().split())
a = 500*k
if a >= x:
  print("Yes")
else:
  print("No")
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
s = list(map(int, [input() for i in range(n)]))
l = [
  [0, 0, 0]
  , [0, 0, 0]
  , [0, 0, 0]
]
for i in range(0, 3):
  for j in range(0, n):
    if a1[i] == s[j]:
      l[0][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a2[i] == s[j]:
      l[1][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a3[i] == s[j]:
      l[2][i] = i+1
count = 0
for i in range(0, 3):
  if l[i][0] and l[i][1] and l[i][2]:
    count += 1
if (l[0][0] and l[1][1] and l[2][2]) or (l[2][0] and l[1][1] and l[0][2]):
  count += 1
else:
  for i in range(1, 4):
    if n.count(i) == 3:
      count += 1
print('Yes' if count >= 1 else 'No')

### FIXED CODE ###

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
s = list(map(int, [input() for i in range(n)]))
l = [
  [0, 0, 0]
  , [0, 0, 0]
  , [0, 0, 0]
]
for i in range(0, 3):
  for j in range(0, n):
    if a1[i] == s[j]:
      l[0][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a2[i] == s[j]:
      l[1][i] = i+1
for i in range(0, 3):
  for j in range(0, n):
    if a3[i] == s[j]:
      l[2][i] = i+1
n = []
for i in l:
  for j in i:
    if j != 0:
      n.append(j)
count = 0
for i in range(0, 3):
  if l[i][0] and l[i][1] and l[i][2]:
    count += 1
if (l[0][0] and l[1][1] and l[2][2]) or (l[2][0] and l[1][1] and l[0][2]):
  count += 1
else:
  for i in range(1, 4):
    if n.count(i) == 3:
      count += 1
print('Yes' if count >= 1 else 'No')
S = input()
if S == ABC:
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

N = input()
if N == "ABC":
  print("ARC")
else:
  print("ABC")
import numpy as np
n,s = [int(c) for c in input().split()]
a = [int(c) for c in input().split()]
# t[i][j] : 0<=r<...,<l=iについて和がsになるようなf(r,l)の和
# t = [[0]*(s+1) for _ in range(n)]
t = np.zeros((n, s+1), dtype="int64")
if a[0]<=s:
    t[0,a[0]] = 1
for i in range(n):
    t[i,0] = i+2
for i in range(1,n):
    for j in range(1,s+1):
        tt = t[i-1,j]
        if j-a[i]>=0:
            tt += t[i-1,j-a[i]]
        t[i,j] = tt
print(t[:,s].sum()%998244353)

### FIXED CODE ###



n, s = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [[None] * (s+1) for _ in range(n+1)]
M = 998244353


for j in range(s+1):
    dp[0][j] = 0
for i in range(n+1):
    dp[i][0] = i+1

for i in range(1,n+1):
    for j in range(1, s+1):
        dp[i][j] = dp[i-1][j]
        if j-a[i-1]>=0:
            dp[i][j] += dp[i-1][j-a[i-1]]
        dp[i][j] %= M
print(sum((dp[i][s] for i in range(n+1)))%M)
import pip._internal.models.target_python

a, b = map(int, input().split())

print(math.ceil((a+b)/2))

### FIXED CODE ###

import math
a, b = map(int, input().split())

print(math.ceil((a+b)/2))
n,k=map(int,input().split())
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)

### FIXED CODE ###

n,k=map(int,open(0))
a=1
while a<k and n:a*=2;n-=1
print(a+k*n)
input = input()
 if len(input.replace("hi", "")) == 0:
  
    print("Yes")
 else
    print("No")


### FIXED CODE ###

input = input()
if len(input.replace("hi", "")) == 0:
  
    print("Yes")
else:
    print("No")
n=int(input())
a=input().split()
dict={}
for i in a:
  if i not in dict:
    dict[i]=1
  else:
    dict[i]+=1

ans=0
for i in dict.keys():
  count=dict[i]
  if count>i:
    ans+=count-i
  elif count<i:
    ans+=count

print(ans)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
dict={}
for i in a:
  if i not in dict:
    dict[i]=1
  else:
    dict[i]+=1

ans=0
for i in dict.keys():
  count=dict[i]
  if count>i:
    ans+=count-i
  elif count<i:
    ans+=count

print(ans)
N, A, B = map(int, input().split())
mo = 10 ** 9 + 7
from functools import lru_cache
@lru_cache(maxsize=10000000)
def hanaya(n, x):
    if x == 1:
        return n
    else:
        return int(((hanaya(n, x-1))*((n-x+1)/x))%mo)

ans = (pow(2, N, mo) - 1 - hanaya(N, A)- hanaya(N, B)) % mo
print(int(ans))

### FIXED CODE ###

N, A, B = map(int, input().split())
mo = 1000000007
A_val = 1
for i in range(A):
    A_val = ((A_val * (N - i) * pow(i+1, mo-2, mo))) % mo
B_val = 1
for i in range(B):
    B_val = ((B_val * (N - i) * pow(i+1, mo-2, mo))) % mo
    
ans = (pow(2, N, mo) - 1 - A_val - B_val) % mo
print(ans)
n = int(input())
xyh_list = [list(map(int, input().split())) for _ in range(n)]
list_0_100 = [i for i in range(0, 101)]
possible_list = []
for b in range(len(xyh_list)):
    if xyh_list[b][2] != 0:
        x1 = xyh_list[b][0]
        y1 = xyh_list[b][1]
        h1 = xyh_list[b][2]
        break
for a in range(b+1, len(xyh_list)):
    x2 = xyh_list[a][0]
    y2 = xyh_list[a][1]
    h2 = xyh_list[a][2]
    break

for i in list_0_100:
    for j in list_0_100:
        if (h2 + abs(x2 - i) + abs(y2 - j)) == (h1 + abs(x1 - i) + abs(y1 - j)):
            possible_list.append([i, j])   # cx, cy 候補
pos_list = []
h0_list = []
for i in range(n):
    if len(possible_list) == 1:
        break
    x = xyh_list[i][0]
    y = xyh_list[i][1]
    h = xyh_list[i][2]
    if h == 0:
        h0_list.append([x, y])
        continue
    for j in range(len(possible_list)):
        x_ = possible_list[j][0]
        y_ = possible_list[j][1]
        if (h + abs(x - x_) + abs(y - y_)) == (h2 + abs(x2 - x_) + abs(y2 - y_)):
            pos_list.append([x_, y_])
    possible_list = pos_list
    pos_list = []

for i in range(len(h0_list)):
    h0 = h0_list[i][0]
    h1 = h0_list[i][1]
    for x_, y_ in possible_list:
        if (h2 + abs(x2 - x_) + abs(y2 - y_)) <= (abs(h0 - x_) + abs(h1 - y_)):
            possible_list = [x_, y_]
print(possible_list[0][0], possible_list[0][1], \
      h2 + abs(x2 - possible_list[0][0]) + abs(y2 - possible_list[0][1]))


### FIXED CODE ###

n = int(input())
xyh_list = [list(map(int, input().split())) for _ in range(n)]
list_0_100 = [i for i in range(0, 101)]
possible_list = []
for a in range(len(xyh_list)):
    if xyh_list[a][2] != 0:
        x1 = xyh_list[a][0]
        y1 = xyh_list[a][1]
        h1 = xyh_list[a][2]
        break

for cx in list_0_100:
    for cy in list_0_100:
        H = h1 + abs(x1 - cx) + abs(y1 - cy)
        count = 0
        for i in range(n):
            x = xyh_list[i][0]
            y = xyh_list[i][1]
            h = xyh_list[i][2]
            if h == max(H - abs(x - cx) - abs(y - cy), 0):
                count += 1
        if count == n:
            ansx = cx
            ansy = cy
            ansH = H
print(ansx, ansy, ansH)
def solve():
    N, A, B = map(int, input().split())

    s = 'b'*A + 'r'*B
    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest
    
    return ans

print(solve())

### FIXED CODE ###

def solve():
    N, A, B = map(int, input().split())

    r = N // (A+B)
    m = N % (A+B)
    
    rest = 0
    if A >= m:
        rest = m
    else:
        rest = A

    ans = A*r + rest

    return ans

print(solve())
A,B,C = int(input().split())
ans = B//A

if ans > C:
	ans = C

print(ans)

### FIXED CODE ###

A,B,C = map(int,input().split())
#A,B,C = 2,1,3
ans = B//A

if ans > C:
	ans = C

print(ans)
n, m = map(int,input().split())

a = [[] for _ in range(n+1)]

for _ in range(m):
    l, r, d = map(int,input().split())
    a[l].append((r,d))
    a[r].append((l,-d))

x = [float('inf') for _ in range(n+1)]

flag = [True]



def check(start,destination,cost):
    #x[destination] = x[start] + cost
    if x[destination] == float('inf'):
        x[destination] = x[start] + cost
        while a[destination]:
            n_destination, n_cost = a[destination].pop()
            check(destination,n_destination,n_cost)
    else:
        if x[destination] == x[start] + cost:
            while a[destination]:
                n_destination, n_cost = a[destination].pop()
                check(destination,n_destination,n_cost)
        else:
            flag[0] = False

for i in range(1,n+1):
    if x[i] == float('inf'):
        x[i] = 0
        for y in a[i]:
            check(i,y[0],y[1])
    else:
        pass

if flag[0]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n, m = map(int,input().split())

a = [[] for _ in range(n)]

for _ in range(m):
    l, r, d = map(int,input().split())
    a[l-1].append((r-1,d))
    a[r-1].append((l-1,-d))

x = [None for _ in range(n)]

def check(y):
    for z,d in a[y]:
        if x[z] is None:
            x[z] = x[y] + d
            if not check(z):
                return False
        elif x[z] != x[y] + d:
            return False
    return True

for i in range(n):
    if x[i] is None:
        x[i] = 0
        if not check(i):
            print('No')
            exit(0)
print('Yes')
N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(n, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in d:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break

### FIXED CODE ###

N, K = map(int, input().split())
D = list(map(str, input().split()))
for i in range(N, 100000):
    s = list(str(i))
    flg = 0
    for j in s:
        if j in D:
            flg = 1
            break
    if flg == 0:
        print("".join(s))
        break
n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    cary = np.delete(ans_list, max(ans_list))
    
else:
    cary = ans_list
number = int(np.median(cary))
ans = 0
for i in ans_list:
    ans += abs(i - number)
print(ans)

### FIXED CODE ###

n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    ans_list1 = sorted(ans_list)
    number1 = ans_list1[n//2]
    number2 = ans_list1[n//2 + 1]
    
    ans1 = 0
    ans2 = 0
    for i in ans_list:
        ans1 += abs(i - number1)
        ans2 += abs(i - number2)
    print(min(ans1 , ans2))
else:
    cary = ans_list
    number = int(np.median(cary))
    ans = 0
    for i in ans_list:
        ans += abs(i - number)
    print(ans)
import math

K = int(input())
res = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            tmp = math.gcd(i, j)s
            res += math.gcd(tmp, k)

print(res)

### FIXED CODE ###

from math import gcd
n=int(input())
ans=0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            ans+=gcd(gcd(i,j),k)
print(ans)
n,a, b = map(int, input().split())
    ans = n //(a+b) *a
    ans += min(n%(a+b),a)
    print(ans)

### FIXED CODE ###

n,a, b = map(int, input().split())
ans = n //(a+b) *a
tmp = n%(a+b)
ans += min(tmp,a)
print(ans)
from fractions import gcd
from functools import reduce
l = [int(input()) for _ in range(int(input()))]
o = reduce(lambda x, y: int(x * y / gcd(x, y)), l)
print(o)

### FIXED CODE ###

from fractions import gcd
l = [int(raw_input()) for _ in range(int(raw_input()))]
o = reduce(lambda x, y: int(x * y / gcd(x, y)), l)
print o
import collections

N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
c.sort()
values, counts = zip(*c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            exit()

### FIXED CODE ###

import collections

n = int(input())

res = []

for _ in range(n):
  res.append(input())

c = collections.Counter(res)
aa = c.most_common()

ss = aa[0][1]
res2 = []

aa.sort()
for i in aa:
  if i[1] == ss:
    res2.append(i[0])

for i in res2:
  print(i)
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k; cin >> k;
    int a = 7%k;
    rep(i,k){
        if (a == 0){
            cout << i+1 << "\n";
            return 0;
        }
        a = (a * 10 + 7)%k;
    }
    cout << -1 << "\n";
}

### FIXED CODE ###

k = int(input())
a = 7%k
s = set()
for i in range(k):
    if a == 0:
        print(i+1)
        break
    a = (a*10+7)%k
else:
    print(-1)
import numpy as np;
from numba import jit
import warnings
from operator import mul
from functools import reduce
warnings.simplefilter('ignore')
    

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    ans = reduce(mul, A)
    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 1
for a in A:
    ans *= a
    if ans > 1000000000000000000:
            print(-1)
            quit()
print(ans)
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M = LI()
    G = [[] for _ in range(N)]
    for _ in range(M):
        a, b = LI_()
        G[a].append(b)
        G[b].append(a)

    ans = [0]
    visited = [False] * N
    def dfs(depth, c):
        visited[c] = True
        if depth == N - 1:
            ans[0] += 1
        else:
            for n in G[c]:
                if not visited[n]:
                    dfs(n, depth + 1)
                    visited[n] = False

    dfs(0, 0)

    print(ans[0])

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, M = LI()
    G = [[] for _ in range(N)]
    for _ in range(M):
        a, b = LI_()
        G[a].append(b)
        G[b].append(a)

    ans = [0]
    visited = [False] * N
    def dfs(c, depth):
        visited[c] = True
        if depth == N - 1:
            ans[0] += 1
        else:
            for n in G[c]:
                if not visited[n]:
                    dfs(n, depth + 1)
                    visited[n] = False

    dfs(0, 0)

    print(ans[0])

if __name__ == '__main__':
    resolve()
import math
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(1, len(a)):
    if i == 1:
        ans = math.gcd(a[0], a[1])
    else:
        ans = math.gcd(ans, a[i])

print(ans)

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(1, len(a)):
    if i == 1:
        ans = fractions.gcd(a[0], a[1])
    else:
        ans = fractions.gcd(ans, a[i])

print(ans)
h, n = map(int, input().split())
al = list(map(int, input().split()))
al_s = sorted(al, reverse=True)

if al_s[0] + al_s[1] >= h:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

h, n = map(int, input().split())
al = list(map(int, input().split()))
al_s = sorted(al, reverse=True)

count = 0
for a in al_s:
    h -= a

if h <= 0:
    print('Yes')
else:
    print('No')