peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
#import sys
#sys.setrecursionlimit(10**7)
#from functools import reduce
#from fractions import gcd


# input
n = int(input())
alist = list(map(int, list(input().split())))

# process/output
if not 1 in alist:
    print(-1)

else:
    ans = 0
    i = 1
    while len(alist) > 0:
        if i in alist:
            index = alist.index(i)
            alist = alist[index+1:]
            ans += index
            i += 1
            
        else:
            break
        
    print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
if a == b:
  print("Draw")
elif (a > b):
  if b == 1:
    print("Bob")
  else:
    print("Alice")
elif (a < b):
  if a == 1:
    print("Alice")
  else:
    print("Bob")
# Judge status: Wrong Answer
S = input()
n = len(S)
for i in range(n):
  print('x')
# Judge status: Wrong Answer
S = input();

if S == "AAA" or "BBB":
  print("No");
else:
  print("Yes");
# Judge status: Accepted
from collections import defaultdict

n, m = map(int, input().split())
PY = [tuple(map(int, input().split())) for _ in range(m)]
ypi = sorted((y, p, i) for i, (p, y) in enumerate(PY))
d = defaultdict(lambda: 0)

ans = [None]*m

for y, p, i in ypi:
    d[p] += 1
    ans[i] = str(p).zfill(6) + str(d[p]).zfill(6)

print(*ans, sep='\n')
# Judge status: Accepted
from collections import defaultdict

d = defaultdict(int)

N = int(input())
for i in range(N):
    d[int(input())] += 1

ans = sum([1 for i in d.values() if i % 2 == 1])
print(ans)
# Judge status: Accepted
n = int(input())
if n<=999:
  print('ABC')
else:
  print('ABD')
# Judge status: Accepted
#!/usr/bin/env python3

s,t=input().split()
print(t+s)
# Judge status: Accepted
# A - Can't Wait for Holiday

week = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
S = str(input())
print(7 - week.index(S) - 1 if S != 'SUN' else 7)
# Judge status: Accepted

n = int(input())
rl = []
for i in range(n):
    x,l = map(int,input().split())
    rl.append([x+l,x-l])
rl.sort()
ans = 1
migihasi = rl[0][0]
hasikouho = []
for i in range(1,n):
    right = rl[i][0]
    left = rl[i][1]
    if left < migihasi:continue
    migihasi = right
    ans += 1

    
        
 
print(ans)
# Judge status: Accepted
n = int(input())
l_a = list(map(int, input().split()))
many = [0]*101000
for i in range(0, len(l_a)) :
    many[l_a[i]-1]+=1
bef = sum(l_a)
q = int(input())
ans = []
for _ in range(q) :
    b, c = map(int, input().split())
    bef += (c - b)*many[b - 1]
    ans.append(bef)
    many[c - 1] += many[b - 1]
    many[b - 1] = 0
 
for value in ans :
    print(value)
# Judge status: Accepted
import itertools


def abc150c_count_order():
    n = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))
    pattern = list(itertools.permutations(range(1, n + 1), n))
    print(abs(pattern.index(p)-pattern.index(q)))


abc150c_count_order()
# Judge status: Accepted
s=input()
k="keyence"
t=""
for i in range(7):
  if k[i]!=s[i]:
    t+=k[:i]
    break
else:
  print("YES")
  exit()
print("YES" if t+s[i-7:]==k else "NO")
# Judge status: Accepted
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while True:
    a = n % 26
    if a == 0:
        n = n//26 - 1
    else:
        n //= 26
    ans = s[a-1] + ans
    if n == 0:
        break
print(ans)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if b-a>k or c-b>k or d-c>k or e-d>k:
	print(":(")
else:
	print("Yay!")
# Judge status: Accepted
import math

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

print( math.floor(t / a) * b )
# Judge status: Accepted
N,K = map(int, input().split())

a = [0]*K
i = 0
while N > 0:
    a[i%K] += 1
    N -= 1
    i += 1

a.sort()
print(a[K-1]-a[0])
# Judge status: Accepted
import sys
from collections import defaultdict
def main():
    input = sys.stdin.readline
    N, K = map(int, input().split())
    count1 = 0
    count2 = 0
    d = []
    l = defaultdict(int)
    
    for i in range(N):
        a,b = map(int, input().split())
        l[a] += b


    for i, j in sorted(l.items()):
        count2 += j
        if count2 >= K:
            print(i)
            break
        

        

if __name__ == "__main__":
    main()
# Judge status: Accepted
def ispalindrome(str): return 1 if str == str[::-1] else 0


def resolve():
    S = list(input())

    if not ispalindrome(''.join(S)):
        print('No')
        return

    num = len(S)
    half = num // 2

    half_1 = S[0:half]
    half_2 = S[half + 1:]

    if not ispalindrome(''.join(half_1)):
        print('No')
        return

    if not ispalindrome(''.join(half_2)):
        print('No')
        return

    print('Yes')


resolve()
# Judge status: Wrong Answer
import math
S=int(input())
ans=0
for i in range(1,int(S//3)+1):
    ans+=math.factorial(i)
    ans%=10**9+7
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
list_a=[]
for d in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  list_a.extend(a)
ans=0
for i in range(1,n): 
 if list_a.count(i)==0:
      ans+=1
print(ans)
# Judge status: Accepted
def pad(n):
	n = str(n)
	if len(n) < 6:
		n = "0"*(6-len(n))+n
	return n

N,M = map(int,input().split())
PY = [list(map(int,input().split())) for _ in range(M)]

for i in range(M):
	PY[i].append(i)
PY.sort()

turn = 1
PY[0].append(pad(PY[0][0])+pad(turn))
for i in range(1,M):
	if PY[i][0] != PY[i-1][0]:
		turn = 1
	else:
		turn += 1
	PY[i].append(pad(PY[i][0])+pad(turn))

PY.sort(key = lambda x:x[2])
for i in range(M):
	print(PY[i][3])
# Judge status: Accepted
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))

TM = [0]*N
for i in range(N):
	TM[i] =  T - H[i]*0.006
	TM[i] = abs(TM[i]-A)

#print(TM)
print(TM.index(min(TM))+1)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
ans = 0

def get_score(c):
    if c == 's':
        score = r
    elif c == 'p':
        score = s
    else:
        score = p
    return score

for i in range(n):
    c = t[i]
    if i < k:
        ans += get_score(c)
    else:
        if c == t[i-k]:
            t[i] = '0'
        else:
            ans += get_score(c)
print(ans)
# Judge status: Wrong Answer
s = input()
T = input()

slen = len(s)
Tlen = len(T)
ans = "UNRESTORABLE"
if slen >= Tlen:
    for i in range(slen - Tlen + 1)[::-1]:
        for j in range(Tlen):
            if not s[i+j] in ("?", T[j]):
                break
        else:
            ans = s
            ans = ans[:i] + T + ans[i+Tlen:]
            ans = ans.replace("?", "a")
            print(ans)
            break

print(ans)
# Judge status: Wrong Answer
N,M = map(int,input().split())

c = ""
for _ in range(M):
  a,b = input().split()
  c += a+b
  
for i in range(1,N+1):
  print(c.count(str(i)))
# Judge status: Wrong Answer
a, b = map(int, input().split())
i = 1
c = 2
while i <= a:
    i += c
    c += 1
print(i-a)
# Judge status: Wrong Answer
N = int(input())

alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def norm(n, prev_list):
	out_list = []
	for line in prev_list:
		for i in range(len(set(line))+1):
			new_line = line + alphabet[i]
			out_list.append(new_line)
	return out_list

init_line = ['a']

for _ in range(N-1):
	init_line = norm(1, init_line)

print(init_line)
# Judge status: Accepted
n,m,k = map(int,input().split())

for i in range(n+1):
    for j in range(m+1):
        tmp = i * (m - j) + (n - i) * j
        if tmp == k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
s = ins()
p = 1
for i in range(26):
    c = s.count(chr(ord('a')+i))
    p = (p*(c+1))%R
print(p-1)
# Judge status: Accepted
import math
N,T=map(int, input().split())
ans = math.inf
for i in range(N):
    c,t=map(int,input().split())
    if t <= T:
        ans = min(ans, c)
print(ans if ans != math.inf else "TLE")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
count = 1
ans = 0
for i in range(n):
    if a[i] == count:
        count += 1
    else:
        ans += 1
if ans == n:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
N=int(input())
p=list(map(int,input().split()))
s=set()
z=0
for i in range(N):
  p[i]//=400
  if p[i]<8:
    s.add(p[i])
  else:
    z+=1
print(len(s),end=' ')
print(len(s)+z)
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
p = 0
while(c > 0):
    c = c - b
    if c == 0:
        break
    a = a - d
    if a == 0:
        p = 1
        break
if p == 1:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
N=int(input())
a=map(int,input().split())
ans,d=0,{}
for x in a:
    d[x]=d.get(x,0)+1
    ans+=1
    if d[x]==x:
        ans-=x
print(ans)
# Judge status: Accepted
from sys import stdin

def main():
    n,m = map(int,stdin.readline().split())
    l = list(map(int,stdin.readline().split()))
    l.sort()
    aco = 0
    for i in range(n-m):
        aco+= l[i]
    print(aco)
        
main()
# Judge status: Accepted
N, K = map(int, input().split())
l = []
while N // K != 0:
  l.insert(-1, N % K)
  N = N // K
l.append(N)
print(len(l))
# Judge status: Wrong Answer
li = list(str(input()))
for i in range(len(li)):
  if(li[i] == "B" and not i == 0):
    li[i-1] = ""
    li[i] = ""
print("".join(li))
# Judge status: Accepted
n = int(input())
if n % 2 == 0:
    print('{:.10f}'.format((n / 2) / n))
else:
    print('{:.10f}'.format(((n + 1) / 2) / n))
# Judge status: Wrong Answer
S = input()
N = len(S)

dp = [0 for _ in range(N)]

dp[0] = 1
dp[1] = 1

for i in range(2, N):
    if S[i] != S[i - 1]:
        dp[i] += dp[i - 1] + 1
    else:
        dp[i] += dp[i - 3] + 2

print(dp[N - 1])
# Judge status: Wrong Answer
N = int(input())

print((N+1)*(N//2))
# Judge status: Accepted
_, *AB = map(int, open(0).read().split())

AB = iter(AB[::-1])
increment = 0

for b, a in zip(AB, AB):
  a += increment
  if a % b:
    increment += b - a % b
    
print(increment)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0

for i in range(n):
    ans += b[a[i]-1]
    if(a[i]!= n and i != n-1 ):
        ans += c[a[i]-1]
print(ans)
# Judge status: Accepted
def resolve():
    n = int(input())
    S = tuple(input())

    c_e = S.count('E')
    c_w = 0
    ans = n

    for s in S:
        if s == 'E':
            c_e -= 1

        ans = min(ans, c_w + c_e)

        # 自分がWの場合はmax計算の後にカウントする
        if s == 'W':
            c_w += 1

    print(ans)
if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
# 入力 : 数字3つ
A, B, C = map(int, input().split())

if A == C or B == C or (A+B) == C :
    print("Yes")
else :
    print("No")
# Judge status: Accepted
from decimal import Decimal

w, h, x, y = map(int, input().split())

print(Decimal(w*h/2), 1 if w == 2*x and h == 2*y else 0)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

t=sum(a)
m=10**9
flag=0
for i in range(len(a)-1):
    t-=2*a[i]
    m=min(t,m)
print(m)
# Judge status: Wrong Answer
n = int(input())
b = list(map(int,input().split()))
a = b[0]
for i in range(n-1):
    a += min(b[i-1],b[i])
a += b[n-2]
print(a)
# Judge status: Accepted
h , w = map(int, input().split())
if h == 1 or w == 1: exit(print(1))
a1 = h//2 + 1 if h % 2 != 0 else h//2
a2 = h - a1
a3 = w//2 + 1 if w%2!=0 else w//2
a4 = w - a3
#print(a1 , a2 , a3,a4)
ans = a1*a3 + a2*a4
print(ans)
# Judge status: Accepted
# 初期入力
N,M = (int(x) for x in input().split())
A = set([int(input()) for i in range(M)])


#
mod_9 = 10**9 +7
dp =[0]*(N +1)
dp[0] = 1
if 1 not in A:
    dp[1] =1
for i in range(N-1):
    if i+2 in A:
        dp[i+2] = 0
    else:
        dp[i+2] = dp[i+1] + dp[i] 
        dp[i+2] %= mod_9
kotae =dp[N] # % mod_9
print(kotae )
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print(b+c-a)
# Judge status: Accepted
n=input().split(' ')
for i in range(0,2):
    if(int(n[i])==1):
        n[i]=14
    n[i]=int(n[i])
if(n[0]>n[1]):
    print("Alice")
elif(n[1]>n[0]):
    print("Bob")
else:
    print("Draw")
# Judge status: Wrong Answer
D = int(input())
c = list(map(int, input().split()))
sdi = [list(map(int, input().split())) for i in range(D)]

lastdi = [0 for i in range(26)]
ans_c = []
for d in range(D):
  
  day_s = sdi[d]
  
  sloss = [day_s[i] + c[i]*(d - lastdi[i]) for i in range(26) ]
  ans = sloss.index(max(sloss))
  ans_c.append( ans )
  
  for i in range(26):
    if i != ans:
      lastdi[i] += 1
  lastdi[ans] = d

for i in range(D):
  print(ans_c[i])
# Judge status: Accepted
N=int(input())
n=int(N**(0.5))
ans=1
for i in range(1,n+1):
    if N%i==0:
        ans=i
    else:
        pass
q=N//ans
print(q+ans-2)
# Judge status: Wrong Answer
from collections import Counter

input()
s = set(map(int, input().split()))
t = {k for k, v in Counter(s).items() if v == 1} 
r = int(1 in t)
if 1 not in s:
  for x in t:
    i = 2
    while i * i <= x:
      if x % i == 0 and  {i, x // i} & s:
        break
      i += 1
    else:
      r += 1
print(r)
# Judge status: Accepted
li = input().split()
print("A"+li[1][0]+"C")
# Judge status: Wrong Answer
import math
a, b, h, m= map(int, input().split())
x = abs(30 * h - 6 * m)
y = 360 - x
z = min(abs(30 * h - 6 * m), y)
c = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(z))
c = math.sqrt(c)
print(c)
# Judge status: Wrong Answer
a,b = map(int,input().split())
kaku_a = 360/16 * a
kaku_b = 360/16 * b
if kaku_a <= 180 and kaku_b <= 180:
    print('Yey!')
else:
    print(':(')
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if(a+b+c==17 and a*b*c==25*7):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')


def main():
	A=LI()
	print(15-sum(A))





if __name__ == "__main__":
	main()
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

counter = 0
for i in range(1,n-1):
    if (p[i]-p[i-1])*(p[i]-p[i+1]) < 0:
        counter += 1
print(counter)
# Judge status: Wrong Answer
lc = [[int(w) for w in input().split()] for i in range(3)]
cond = False

lb = lc[0]
a2 = lc[1][0]-lb[0]
a3 = lc[2][0]-lb[0]
la = [0, a2, a3]
for i in range(3):
    for j in range(3):
        if lc[i][j] != la[i]+lb[j]:
            cond = False
            break

print("Yes" if cond else "No")
# Judge status: Accepted
n = int(input())
a = sorted(map(int, input().split()))

ave = round(sum(a) / n)
ans = sum(map(lambda x: (ave - x) ** 2, a))
print(ans)
# Judge status: Accepted
import sys
n, m = [int(i) for i in sys.stdin.readline().split()]
_set = set()
ac = 0
wa = 0
ls = []
for i in range(m):
    p, s = [i for i in sys.stdin.readline().split()]
    if s == "AC":
        _set.add(p)
    ls.append([p, s])

new_set = set()
for p, s in ls:
    if s == "AC":
        new_set.add(p)
    if s == "WA" and p in _set and p not in new_set:
        wa += 1
print(len(_set), wa)
# Judge status: Wrong Answer
r = int(input())
print(360 / r)
# Judge status: Wrong Answer
N = int(input())
S = input()

cr = 0
cl = 0

for i in range(N):
  if i == "(":
    cr += 1
  else:
    if cr > 0:
      cr -= 1
    else :
      cl += 1
      
print("("*cl+S+")"*cr)
# Judge status: Wrong Answer
a=[0,1,3,1,2,1,2,1,1,2,1,2,1]

x,y=map(int,input().split())
if a[x]==a[y]:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import math
from collections import defaultdict

def get_max_frequency(x):
  n = 1
  while True:
    if n*(n+1)/2 <= x and x < (n+1)*(n+2)/2:
      break
    n += 1
  return n

N = int(input())
divided = N
d = defaultdict(int)
ans = 0

for i in range(2, int(math.sqrt(N)//1)+1):
  while True:
    if divided%i == 0:
      divided //= i
      d[i] += 1
    else:
      break
d[divided] += 1
if 1 in d:
  del d[1]

for v in d.values():
  ans += get_max_frequency(v)

print(ans)
# Judge status: Accepted
N = int(input())

ans=0
for _ in range(1,N+1,2):
    eight=0
    for i in range(1,N+1):
        if _ % i ==0:
            eight +=1
    
    if eight == 8:
        ans+=1
        

print(ans)
# Judge status: Accepted
n = int(input())
s = list(input())
d = [0]
x = 0

for i in range(len(s)):
    if s[i] == '(':
        x += 1
    else:
        x -= 1
    d.append(x)

ans = []
x = min(d)

for i in range(max(0,(-1*x))):
    ans.append('(')

for i in s:
    ans.append(i)

for i in range(max(d[len(d)-1]-x,0)):
    ans.append(')')

a = ''.join(ans)

print(a)
# Judge status: Wrong Answer
import math
x = int(input())
if x % 2 == 0:
  n = x + 1
else:
  n = x + 2
while True:
  isPrime = True
  for i in range(2, int(math.sqrt(n))):
    if n % i == 0:
      isPrime = False
      break
  if isPrime:
    print(n)
    break
  n += 2
# Judge status: Accepted
#import sys
#input = sys.stdin.

def main():
    N = int(input())
    num = 97
    T = [[0 for _ in range(N)] for _ in range(26)]
    for i in range(N):
        S = list(map(str,input()))
        for moji in S:
            T[ord(moji)-num][i] += 1
            
    ans = ""
    for i in range(26):
        use = min(T[i])
        ans += chr(num+i)*use
    
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = input()
a = list(map(int, input().split()))

a.sort(reverse=True)
alice_score = sum(a[0::2])
bob_score = sum(a[1::2])

print(alice_score - bob_score)
# Judge status: Accepted
import numpy as np
from numba import njit, i8

n, k = map(int, input().split())
arr = np.array(list(map(int, input().split())))


@njit(i8[:](i8, i8, i8[:]))
def solve(n, k, arr):
    for i in range(min(k, 50)):
        tmp_arr = np.zeros(n + 2, np.int64)
        for i, power in enumerate(arr):
            tmp_arr[max(0, i - power + 1)] += 1
            tmp_arr[min(n + 1, i + power + 2)] -= 1
        arr = np.cumsum(tmp_arr)[1:-1]
    return arr


print(*solve(n, k, arr))
# Judge status: Wrong Answer
n = int(input())
sp = [input().split() for _ in range(n)]
sp_s = sorted(sp, key=lambda x:(x[0], -int(x[1])))
for i in sp:
    print(sp_s.index(i)+1)
# Judge status: Accepted
nq = list(map(int,input().split()))
n = nq[0]
q = nq[1]
s = input()
lr = [map(int, input().split()) for _ in range(q)]
l, r = [list(i) for i in zip(*lr)]
sam = [0]*n
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        sam[i+1] = sam[i] + 1
    else:
        sam[i+1] = sam[i]
for i in range(q):
    ans = sam[r[i]-1] - sam[l[i]-1]
    print(ans)
# Judge status: Accepted
import sys

def main():
    N = int(sys.stdin.readline().rstrip())
    H = list(map(int, input().split()))


    for x in reversed(range(1, N)):
        if H[x] >= H[x-1]:
            pass

        elif  H[x] == H[x-1] - 1:
            H[x-1] -= 1

        else:
            print('No')
            sys.exit()

    print('Yes')


main()
# Judge status: Accepted
#6→5を交互に上に向けるのが効率良い

n = int(input())
if n%11 == 0:
    print(n//11*2)
elif n%11 < 7:
    print((n//11)*2+1)
else:
    print((n//11+1)*2)
# Judge status: Wrong Answer
import math
n = int(input())

res = 0
if n <= 1:
	print(res)
else:
	max_num = math.ceil(math.sqrt(n + 1))
	org_n = n
	for z in range(2, max_num + 1):
		if n % z == 0:
			z_p = 1
			while n % z == 0:
				if n % z ** z_p == 0:
					res += 1
				n = n // z
				z_p += 1
		if n == z:
			break
	if org_n == n:
		res += 1
	print(res)
# Judge status: Wrong Answer
a,b = map(int, input().split())
total = max(a,b)
print(total+(total-1))
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()



def main():
	A=LI()
	A.sort()
	ans=0

	if A[0]%2 and A[1]%2 and A[2]%2:
		ans=A[0]*A[1]

	print(ans)




if __name__ == "__main__":
	main()
# Judge status: Wrong Answer
X = int(input())
if X == 3 or X == 5 or X == 7:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def f(a,b):
    if a!=3 and b!=3:
        return 3
    if a!=2 and b!=2:
        return 2
    if a!=1 and b!=1:
        return 1
a=int(input())
b=int(input())
print(f(a,b))
# Judge status: Accepted
from collections import deque
N, M = map(int, input().split())
g = [[] for i in range(N+1)]
for _ in range(M):
    A, B = map(int, input().split())
    g[A].append(B)
    g[B].append(A)
Q = deque()
vstd = [0]*(N+1)
mark = [0]*(N+1)
vstd[1] = 1
Q.append(1)
while Q:
    par = Q.popleft()
    for r in g[par]:
        if vstd[r]:
          continue
        mark[r]=par
        vstd[r]=1
        Q.append(r)
print('Yes')
for mk in mark[2:]:
    print(mk)
# Judge status: Wrong Answer
S = input()
if S[0] == S[1] and S[2] == S[3]:
    print ("Yes")
elif S[0] == S[2] and S[1] == S[3]:
    print ("Yes")
elif S[0] == S[3] and S[1] == S[2]:
    print ("Yes")
else:
    print ("No")
# Judge status: Accepted
l = [4, 6, 9, 11]
x, y = map(int, input().split())
if x == 2 or y == 2:
    print('No')
elif x in l and y in l:
    print('Yes')
elif x not in l and y not in l:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
if int(input())>=3200:
  print("red")
else:
  print(input())
# Judge status: Accepted
n = int(input())
s = input()
abc =['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
ans = ''
for i in range(len(s)):
  ans += abc[(abc.index(s[i]) + n) % 26]
print(ans)
# Judge status: Accepted
def main():
  N, K = map(int, input().split())
  A_list = input().split()

  root = [1]

  record = [-1]*N
  break_flag = 0
  for n in range(K):
    new = int(A_list[ int(root[n])-1 ])
    if record[new-1] <0:
      record[new-1]=1
      root.append(new)
    else:
      ind = root.index(new)
      break
  else:
    print(new)
    break_flag = 1
    
  if break_flag == 0:  
	  pre = len(root[:ind])
	  roop = len(root)-pre

	  print(root[ind:][(K-pre)%roop])
   
if __name__ == '__main__':
  main()
# Judge status: Accepted
N = int(input())
amari = N % 2
count = int( N // 2 )
print( count + amari )
# Judge status: Accepted
n,m=map(int,input().split())
t=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    t[a-1]+=1
    t[b-1]+=1
for x in t:
  print(x)
# Judge status: Wrong Answer
n=int(input())
h=list(map(int,input().split()))
dp=[10**5]*n
for i in range(n):
  if i==0:
    dp[i]=0
  elif i==1:
    dp[i]=abs(h[1]-h[0])
  else:
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp)
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = input().split()
travail = 0
for i in range(0, len(A)):
    A[i] = int(A[i])
    travail += A[i]

if N - travail > 0:
    print(N - travail)
else:
    print(-1)
# Judge status: Wrong Answer
x=int(input())
a=x//500
y=x-(500*a)
b=y//5
print(a*1000+b*1)
# Judge status: Accepted
Z = []
for s in input():
  Z.append(int(s))

def dfs(index, value, ops):
  if index == 4:
    if value == 7:
      print("{}{}{}{}{}{}{}=7".format(Z[0],ops[0],Z[1],ops[1],Z[2],ops[2],Z[3]))
      # print(f"{Z[0]}{ops[0]}{Z[1]}{ops[1]}{Z[2]}{ops[2]}{Z[3]}=7")
      exit()
    return
  dfs(index + 1, value + Z[index], ops + ["+"])
  dfs(index + 1, value - Z[index], ops + ["-"])

dfs(1, Z[0], [])
# Judge status: Accepted
a,b,c = [int(x) for x in input().split()]
res = 3 * max(a,b,c) - (a + b + c)
if res % 2 == 1:
  res += 3
print(res // 2)