Harryxun/stf_run huggingface dataset:
bingo = []
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
for i in len(bingo):
    bingo[i] = [int(bingo[i][0]), int(bingo[i][1]), int(bingo[i][2])]

n = input()
data = []
arr = range(int(n))
arr = list(arr)
for count in arr:
    tmp = input()
    data.append(int(tmp))

ans = []
for num in data:
    for i in len(bingo):
        for j in [0, 1, 2]:
            if bingo[i][j] is num:
                ans.append([i, j])

# 1 2 3
# 4 5 6
# 7 8 9

# 6 15 12 15 15 24 18
# more 3

# 11 12 13
# 21 22 23
# 31 32 33

if [0, 0] in ans and [0, 1] in ans and [0, 2] in ans:
    print('Yes')
    exit(0)

if [1, 0] in ans and [1, 1] in ans and [1, 2] in ans:
    print('Yes')
    exit(0)

if [2, 0] in ans and [2, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 0] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

if [0, 1] in ans and [1, 1] in ans and [2, 1] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 2] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 1] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

print('No')


### FIXED CODE ###

bingo = []
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
for i in range(len(bingo)):
    bingo[i] = [int(bingo[i][0]), int(bingo[i][1]), int(bingo[i][2])]

n = input()
data = []
arr = range(int(n))
arr = list(arr)
for count in arr:
    tmp = input()
    data.append(int(tmp))

ans = []
for num in data:
    for i in range(len(bingo)):
        for j in [0, 1, 2]:
            if bingo[i][j] is num:
                ans.append([i, j])

# 1 2 3
# 4 5 6
# 7 8 9

# 6 15 12 15 15 24 18
# more 3

# 11 12 13
# 21 22 23
# 31 32 33

if [0, 0] in ans and [0, 1] in ans and [0, 2] in ans:
    print('Yes')
    exit(0)

if [1, 0] in ans and [1, 1] in ans and [1, 2] in ans:
    print('Yes')
    exit(0)

if [2, 0] in ans and [2, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 0] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

if [0, 1] in ans and [1, 1] in ans and [2, 1] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 2] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 1] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

print('No')
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, M = map(int, input().split())
    A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

	print(max(-1,N-sum(A)))




if __name__ == "__main__":
    main()

### FIXED CODE ###


# -*- coding: utf-8 -*-
N,M=map(int, input().split())
As=list(map(int, input().split()))


tot=sum(As)
if tot>N:
    print(-1)
else:
    print(N-tot)
n, m = list(map(int, input().split()))
ac_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(m):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))

### FIXED CODE ###

n, m = list(map(int, input().split()))
ac_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(n):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))
n=int(input())
a=list(int(input()) for i in range(n-1))
if a[i]=max(a) for i in range(n-1):
  a.remove(a[i])
  print(max[a])
else:
  print(max[a])



### FIXED CODE ###

##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])
import math
import fractions
import sys
import itertools
import numpy as np
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))


N=input1()
A=np.array(input_array())
mod=10**9-7
s=0

for i in range(60):
	c1=np.count_nonzero(A & 1)
	s+=2**i*c1*(n-c1)
	A = A >> 1

print(s % mod)













### FIXED CODE ###

import numpy as np

n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    c1 = np.count_nonzero(arr & 1) # 自分がnp.sumを利用したがどうしても正解になれなかった。なぜ？
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)
import sys
input = sys.stdin.readline
from collections import deque

def main():
    x,y=map(int,input().split())
    MOD=10**9+7
    if (x+y)%3!=0:
        print(0)
    else:
        n=int((x+y)/3)
        k=int((2*x-y)/3)
    a,b=1,1
    for i in range(k):
        a=(a*(n-i))%MOD
        b=(b*(1+i))%MOD
    ans=(a*pow(b,MOD-2,MOD))%MOD
    print(int(ans))
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import deque
import math

def main():
    def pre(n,MOD):
        a=1
        for i in range(1,n+1):
            a=(a*i)%MOD
        an=a
        b=pow(a,MOD-2,MOD)
        bs=[1]*(n+1)
        bs[n]=b
        for i in range(n,1,-1):
            b=b*i%MOD
            bs[i-1]=b
        return an,bs
    
    x,y=map(int,input().split())
    d=(x+y)//3
    MOD=10**9+7
    if (x+y)%3!=0 or x<d or y<d:
        print(0)
    else:
        a,b=pre(d,MOD)
        a=a*b[y-d]*b[2*d-y]%MOD
        print(a)

if __name__ == '__main__':
    main()
n=int(input()) 
l=list(map(int,input().split())) 
dic_l={} 
lst_1=[] 
for i in range(n): 
  dic_l[l[i]]=i 
  for j in range(1,n+1): 
    lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))

### FIXED CODE ###

n=int(input()) 
l=list(map(int,input().split())) 
dic_l={} 
lst_1=[] 
for i in range(n): 
	dic_l[l[i]]=i 
for j in range(1,n+1):
	lst_1.append(str(dic_l[j]+1)) 
print(" ".join(lst_1))
#for _ in range(int(input())):
def zeroPad(numberString, zeros, left = True):
    """Return the string with zeros added to the left or right."""
    for i in range(zeros):
        if left:
            numberString = '0' + numberString
        else:
            numberString = numberString + '0'
    return numberString
def karatsubaMultiplication(x ,y):
    """Multiply two integers using Karatsuba's algorithm."""
    #convert to strings for easy access to digits
    x = str(x)
    y = str(y)
    #base case for recursion
    if len(x) == 1 and len(y) == 1:
        return int(x) * int(y)
    if len(x) < len(y):
        x = zeroPad(x, len(y) - len(x))
    elif len(y) < len(x):
        y = zeroPad(y, len(x) - len(y))
    n = len(x)
    j = n//2
    #for odd digit integers
    if (n % 2) != 0:
        j += 1    
    BZeroPadding = n - j
    AZeroPadding = BZeroPadding * 2
    a = int(x[:j])
    b = int(x[j:])
    c = int(y[:j])
    d = int(y[j:])
    #recursively calculate
    ac = karatsubaMultiplication(a, c)
    bd = karatsubaMultiplication(b, d)
    k = karatsubaMultiplication(a + b, c + d)
    A = int(zeroPad(str(ac), AZeroPadding, False))
    B = int(zeroPad(str(k - ac - bd), BZeroPadding, False))
    return A + B + bd
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=karatsubaMultiplication(ans[i-1],x[i])/x[c]
  if ans[i]>ans[i-1]:
    print('Yes')
  else:print('No')
  c+=1


### FIXED CODE ###

#for _ in range(int(input())):
n=int(input())
if n>=400 and n<=599:print(8)
elif n>=600 and n<=799:print(7)
elif n>=800 and n<=999:print(6)
elif n>=1000 and n<=1199:print(5)
elif n>=1200 and n<=1399:print(4)
elif n>=1400 and n<=1599:print(3)
elif n>=1600 and n<=1799:print(2)
elif n>=1800 and n<=1999:print(1)
# 085 C
N,Y = map(int, input().split())
for x in range(N):
    for y in range(N):
        for z inrange(N):
            if ((10000*x + 5000*y + 1000*z) == Y) and ((x + y + z) == N):
                print(x' 'y' 'z' ')
                exit()
print('-1 -1 -1')

### FIXED CODE ###

# 085 C
N,Y = map(int, input().split())
x,y,z = -1,-1,-1
for i in range(N+1):
    for j in range(N+1):
        if ((10000*i + 5000*j + 1000*(N-i-j)) == Y)and(N-i-j>=0):
            x,y = i,j
            z = N - i - j
            break
    else:
        continue
    break
print(x,y,z)
N, X, T = map(int, input().split())

print(floor(N/X) * T + 1)

### FIXED CODE ###

import math
N, X, T = map(int, input().split())
 
if N % X == 0:
  print(int(N / X * T))
else:
  print((math.floor(N/X) + 1) * T)
n=int(input())
ans=0
a=0;b=0;ab=0
for i in range(n):
  s=input()
  ans+=s.count("AB")
  if s[0]=="B":
    b+=1
    if s[-1]=="A":
      ab+=1
      b-=1
  elif s[-1]=="A":
    a+=1
print(ans+c-1+min(a,b))

### FIXED CODE ###

n=int(input())
ans=0
a=0;b=0;ab=0
for i in range(n):
  s=input()
  ans+=s.count("AB")
  if s[0]=="B":
    b+=1
    if s[-1]=="A":
      ab+=1
      b-=1
  elif s[-1]=="A":
    a+=1
if a+b==0:
    print(ans+max(ab-1,0))
else:
    print(ans+min(a,b)+ab)
line = input().split()
object_ = input()

N = int(line[0])
A = int(line[1])-1
B = int(line[2])-1
C = int(line[3])-1
D = int(line[4])-1

placing_objects = [True if s == '#' else False for s in list(object_)]

def main():
    if (A < B and C < D) or (A > B and C > D):
        for i in range(N-1):
            if placing_objects[i] and placing_objects[i+1]:
                print('No')
                return
        print('Yes')
        return
    elif (A > C) or (B > D):
        print('No')
        return
    else:
        possible_trans = False
        trans_index = -1
        for i in range(N-1):
            if placing_objects[i] and placing_objects[i+1]:
                print('No')
                return
            if i < N-2 and (not placing_objects[i]) and (not placing_objects[i+1]) and (not placing_objects[i+2]):
                possible_trans = True
                trans_index = i+1
        if not possible_trans:
            if C < D:
                if placing_objects[C-1] or placing_objects[C+1]:
                    print('No')
                    return
            else:
                if placing_objects[D-1] or placing_objects[D+1]:
                    print('No')
                    return
        else:
            if A > B:
                if A > trans_index[0]:
                    print('No')
                    return
            else:
                if B > trans_index[0]:
                    print('No')
                    return
        print('Yes')
        
main()

### FIXED CODE ###

line = input().split()
object_ = input()

N = int(line[0])
A = int(line[1])-1
B = int(line[2])-1
C = int(line[3])-1
D = int(line[4])-1

placing_objects = [True if s == '#' else False for s in list(object_)]

def main():
    if (A < B and C < D) or (A > B and C > D):
        for i in range(N-1):
            if placing_objects[i] and placing_objects[i+1] and i > A and i < max(C, D):
                print('No')
                return
        print('Yes')
        return
    else:
        possible_trans = False
        trans_index = []
        for i in range(N-1):
            if placing_objects[i] and placing_objects[i+1] and i > A and i < max(C, D):
                print('No')
                return
            if i < N-2 and (not placing_objects[i]) and (not placing_objects[i+1]) and (not placing_objects[i+2]):
                possible_trans = True
                trans_index.append(i+1)
        if not possible_trans:
            if C < D:
                if placing_objects[C-1] or placing_objects[C+1]:
                    print('No')
                    return
            else:
                if placing_objects[D-1] or placing_objects[D+1]:
                    print('No')
                    return
        else:
            if A > B:
                if A > max(trans_index):
                    print('No')
                    return
            else:
                if B > max(trans_index) or D < min(trans_index):
                    print('No')
                    return
        print('Yes')
        
main()
n, m = map(int, input().split(" "))
r = [""] * m
for c in range(m):
    r[c] = list(map(int, input().split(" ")))

#print(r)
ac = 0
for c in range(n):
    num = c + 1 # num がカード番号
    for co in range(m): # co がゲート番号
        if r[co][0] <= num <= r[co][1]:
            #print("card{} is ok for gate{}".format(num, co))
            pass
        else:
            break
    else:
        ac += 1

print(ac)

### FIXED CODE ###

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

if 13 <= a:
    print(b)
elif 6 <= a:
    print(round(b /2))
else:
    print("0")
a, b, c = map(int(input().split()))

if a == b == c:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if a == b == c:
    print('Yes')
else:
    print('No')
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i], p[i] = p[i], p[i - 1]
                count += 1
        except:
            break
    print(count)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            count += 1
            if len(p) != i:
                p[i - 1], p[i] = p[i], p[i - 1]
    print(count)

if __name__ == '__main__':
    main()
i = 1
while 1:
  x = int(input())
  if x==0: break
  print('Case ' i ': ' x)
  i += 1


### FIXED CODE ###

i,x = 1,input()
while x != "0":
  print('Case '+str(i)+': '+x)
  i,x = i+1,input()
n1, n2 = map(lambda x: int(x), input().split())

if n1 == 9 or n2 == 9:
  print('Yes')
else:
  print('No')



### FIXED CODE ###

n = input()
n1 = int(n[0])
n2 = int(n[1])

if n1 == 9 or n2 == 9:
  print('Yes')
else:
  print('No')
n = int(input())
a = [0]
for i in range(1, n + 1):
    a.append(int(input()))


btn2 = a.index(2)
cnt = 1
idx = 1
for i in range(1, n + 1):
    if a[idx] == btn2:
        cnt += 1
        print(cnt)
        break
    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)

### FIXED CODE ###

n = int(input())
a = [0]
for i in range(n):
    a.append(int(input()))

cnt = 1
idx = 1
for i in range(n):
    if a[idx] == 2:
        print(cnt)
        break

    else:
        idx = a[idx]
        cnt += 1
else:
    print(-1)
n=map(int,input().split())
t= list(map(int,input().split()))

import sys
import collections
c = collections.Counter(t)
c=sorted(list(c.values()))
ans=0
delete_count=len(c)-k
if delete_count<=0:
    print(0)
    sys.exit()
else:
    for i in range(delete_count):
        if len(c)>k:
            ans+=c[i]
            
print(ans)
sys.exit()
        



### FIXED CODE ###

n,k=map(int,input().split())
t= list(map(int,input().split()))

import sys
import collections
c = collections.Counter(t)
c=sorted(list(c.values()))
ans=0
delete_count=len(c)-k
if delete_count<=0:
    print(0)
    sys.exit()
else:
    for i in range(delete_count):
        if len(c)>k:
            ans+=c[i]
            
print(ans)
sys.exit()
N=int(input())
l=[]
l_value=[]
i=0
stack=-1
for i in range(N):
    if i <= N:
        stack=input()
        l.append(stack)
list_simple=[]
for i in l:
    if stack != i:
        list_simple.append(i)
dp_dict=[]
dp=1
for i in list_simple:
    if c not in dp_dict:
        dp_dict[c] = 0
    dp = dp_dict[c] +dp
    dp_dict[c] = dp
print(dp)


### FIXED CODE ###

N=int(input())
l=[]
l_value=[]
i=0
stack=-1
for i in range(N):
    if i < N:
        l.append(input())
list_simple=[]
for i in l:
    if stack != i:
        list_simple.append(i)
    stack = i
dp_dict=[0]*200001
dp=1
for i in list_simple:
    i=int(i)
    dp = dp_dict[i] +dp
    dp_dict[i] = dp
print(dp%(10**9+7))
def main():
    n = int(input())
    x = input()
    x = '0b'+x

    x = int(x,0)
    m = bin(x).count('1')
    # print(x)

    a = x%(m-1)
    b = x%(m+1)
    # exit()

    ans = dict()
    tmp_a = 1
    tmp_b = 1
    xx = [None] * n

    for i in range(n):
        if (x >> i) &1:
            y = (a - tmp_a)%(m-1)
        else:
            y = (b+tmp_b)%(m+1)
        tmp_a *= 2
        tmp_a %= (m-1)
        tmp_b *= 2
        tmp_b %= (m+1)
        # print(tmp_a,tmp_b)

        z = x ^ (1<<i) 
        t = z
        z %= bin(z).count('1')
        # y = z
        # print(t,z,y)

        cnt = 1
        c = y
        while y != 0:
            # if y in ans.keys():
            #     cnt += ans[y]
            #     break
            cnt += 1
            y = solve(y)
        ans[c] = cnt
        xx[i] = cnt
    
    for i in range(n-1,-1,-1):
        print(xx[i])

def solve(n):
    m = bin(n).count('1')
    return n%m

main()


### FIXED CODE ###

def main():
    n = int(input())
    x = input()
    x = '0b'+x

    x = int(x,0)
    m = bin(x).count('1')

    if m > 1:
        a = x%(m-1)
    b = x%(m+1)
    tmp_a = 1
    tmp_b = 1
    xx = []

    for i in range(n):
        if (x >> i) &1:
            if m == 1:
                xx.append(0)
                continue
            else:
                y = (a - tmp_a)%(m-1)
        else:
            y = (b + tmp_b)%(m+1)
        tmp_a *= 2
        if m > 1:
            tmp_a %= (m-1)
        tmp_b *= 2
        tmp_b %= (m+1)

        cnt = 1
        while y != 0:
            cnt += 1
            y = solve(y)
        xx.append(cnt)
    
    # print(xx)
    for i in range(n-1,-1,-1):
        print(xx[i])

def solve(n):
    m = bin(n).count('1')
    return n%m

main()
def main():
    h, w, a, b = map(int, input().split())
    r = [w - a] * h
    c = [h - b] * w
    t = [[0] * w for _ in range(h)]
    for y in range(w, -1, -1):
        x = (b * y + (h - b) * (w - y) - h * (w - a)) / (2 * a - w)
        if int(x) == x and 0 <= x <= h:
            x = int(x)
            break
    else:
        print("No")
        exit()
    for i in range(x):
        r[h - 1 - i] = a
    for i in range(y):
        c[w - 1 - i] = b
    for i in range(h):
        j = 0
        while r[i] > 0:
            if c[j] == 0:
                j += 1
                continue
            t[i][j] = 1
            r[i] -= 1
            c[j] -= 1
            j += 1
    for x in t:
        print(*x, sep="")

main()


### FIXED CODE ###

from heapq import *

def main():
    h, w, a, b = map(int, input().split())
    r = []
    c = []
    t = [[0] * w for _ in range(h)]
    br = False
    for x in range(h + 1):
        for y in range(w + 1):
            if a * (h - x) + (w - a) * x == b * (w - y) + (h - b) * y:
                br = True
                break
        if br: break
    else:
        print("No")
        exit()
    for i in range(x):
        heappush(r, [-w + a, i])
    for i in range(x, h):
        heappush(r, [-a, i])
    for j in range(y):
        heappush(c, [-h + b, j])
    for j in range(y, w):
        heappush(c, [-b, j])
    while r:
        e0, i = heappop(r)
        tmp = []
        for _ in range(-e0):
            e1, j = heappop(c)
            t[i][j] = 1
            if -e1 > 1: tmp.append([e1 + 1, j])
        for l in tmp:
            heappush(c, l)
    for x in t:
        print(*x, sep="")

main()
a, b = map(int, input().split())
bool1=False
#print(a,"to",b) a=21 b=1 i=3 j=7 out
if 1<=a and a<=20 and 1<=b and b<=20
for i in range(10):
	for j in range(10):
		#print(i)
		if i*j == a*b:
			#print("a")
			bool1=True
			#print(bool1)
			break
		else:
			#print("j={0}".format(j))
			pass
	if bool1==True:
		break
#print(bool1)
if bool1==True:
	print(a*b)
else:
	print(-1)


### FIXED CODE ###

a, b = map(int, input().split())
if a<=9 and b<=9:
	print(a*b)
else:
	print(-1)
in = [int(i) for i in input().split()]
print(max(in[0] * in[1], in[2] * in[3]]))

### FIXED CODE ###

a,b,c,d= [int(i) for i in input().split()]
print(max(a * b, c * d))
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    a = LI()
    d = collections.defaultdict(int)
    for c in a:
        d[c] += 1
    t = sorted(list(d.keys()))
    if t[-1] - t[0] > 1:
        return 'No'
    if len(t) == 1:
        if t[0] == n - 1:
            return 'Yes'
        if t[0] > n / 2.0:
            return 'No'
        return 'Yes'
    b = t[1] - d[t[0]]
    n2 = d[t[1]]
    print(1/0)
    if n2 == 2 and b == n2 - 1:
        return 'Yes'
    if b < 1:
        return 'No'
    if b >= n2 - 2:
        return 'No'

    return 'Yes'


print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    a = LI()
    d = collections.defaultdict(int)
    for c in a:
        d[c] += 1
    t = sorted(list(d.keys()))
    if t[-1] - t[0] > 1:
        return 'No'
    if len(t) == 1:
        if t[0] == n - 1:
            return 'Yes'
        if t[0] > n / 2.0:
            return 'No'
        return 'Yes'
    b = t[1] - d[t[0]]
    n2 = d[t[1]]
    if n2 == 2 and b == n2 - 1:
        return 'Yes'
    if b < 1:
        return 'No'
    if b >= n2 - 2:
        return 'No'
    if b > n2 / 2.0:
        return 'No'

    return 'Yes'


print(main())