peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import defaultdict
dic = defaultdict(int) 
N = int(input())
for i in range(N):
  temp = int(input())
  dic[i+1] = temp
#print(dic)
ans = 0
L = list(dic.keys())
nokori = -1
for i in range(N):
  if dic[L[i]] >= 1 and L[i]-nokori <= 1:
    ans += 1
    dic[L[i]] -=1
    nokori = -1
  ans += dic[L[i]]//2
  if dic[L[i]]%2 == 1:
    nokori = L[i]
print(ans)
# Judge status: Accepted
#A
X = int(input())

if 400 <= X <= 599:
    print(8)
elif 600 <= X <= 799:
    print(7)
elif 800 <= X <= 999:
    print(6)
elif 1000 <= X <= 1199:
    print(5)
elif 1200 <= X <= 1399:
    print(4)
elif 1400 <= X <= 1599:
    print(3)
elif 1600 <= X <= 1799:
    print(2)
elif 1800 <= X <= 1999:
    print(1)
# Judge status: Wrong Answer
from collections import defaultdict
N = int(input())
S = input()
mod = 10**9 + 7

d = defaultdict(int)

ans = 0
for s in S:
    d_tmp = d.copy()
    for k, v in d.items():
        if s not in k:
            ans += v
            ans %= mod
            d_tmp[k+s] += 1
    d = d_tmp.copy()
    d[s] += 1
    ans += 1
    ans %= mod
print(ans)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))
m=list(map(int,input().split()))
q=[]

j=0
while 0<=j and j<=n-1:
    p=0
    for k in range(j+1):
        p+=l[k]
    for o in range(n-j):
        p+=m[o+j]
    q.append(p)
    j+=1
print(q)
print(max(q))
# Judge status: Wrong Answer
n = int(input())

m = n % 1000

if m < 501:
    print(m)
else:
    print(1000-m)
# Judge status: Accepted
def main():
    n, sum = list(map(int,input().split()))
    x_max = sum // 10000
    for x in reversed(range(0, x_max + 1)):
        for y in range(n - x + 1):
            z = n - x - y
            if 10000 * x + 5000 * y + 1000 * z == sum:
                    print(x, y, z)
                    return 0
    print('-1 -1 -1')
    return 0

main()
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if a==c:
    print(abs(b-d))
elif a<c:
    if b>d:
        print(d-c)
    else:
        print(max(0,b-c))
else:
    if b<d:
        print(b-a)
    else:
        print(max(0,d-a))
# Judge status: Accepted
n, l = map(int, input().split())
s = sorted([input() for _ in range(n)])

print(''.join(s))
# Judge status: Wrong Answer
num=int(input())
line =list(map(int,input().split())) 
line2 =[0]*num                          
for i in range(num):
  line2[line[i]-1]=i+1
print(" ".join(map(str,line)))
# Judge status: Wrong Answer
a,b,c = input().split()
 
score = 1
if a != b:
	score = score + 1
elif b !=c:
	score = score + 1
elif c !=a:
	score = score + 1
else:
	score = score
print(score)
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a = int(input())
    b = int(input())
    h = int(input())
    print((a+b)*h//2)

if __name__ == '__main__':
    main()
# Judge status: Accepted
from decimal import Decimal
def main():
    YES="Yes"
    NO="No"
    a,b,c = map(int, input().split())
    if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
        print(YES)
    else:
        print(NO)
    return

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c = map(int, input().split())
count = 0
if a==b:
  count = count + 1
if b==c:
  count = count + 1
if c==a:
  count = count + 1
if count == 1:
  print("Yes")
else:
  print("No")
# Judge status: Accepted

n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
    b[i]=a[i]-(i+1)

b.sort()

b2=b[n//2]

bsum=0
for i in range(n):
    bsum+=abs(b[i]-b2)
    
bsum2=0
for i in range(n):
    bsum2+=abs(b[i]-b2-1)

print(min(bsum,bsum2))
# Judge status: Accepted
N = int(input())

ans = [0] * (N + 5)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp <= N:
                ans[tmp] += 1

for i in range(1, N+1):
    print(ans[i])
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    c=[]
    s=0
    for i in range(3):
        li=list(map(int,readline().split()))
        s+=sum(li)
        c.append(li)

    if s%3!=0:
        print("No")
    else:
        if c[0][0]+c[1][1]+c[2][2]==s//3:
            print("Yes")
        else:
            print("No")

if __name__=="__main__":
    main()
# Judge status: Accepted
S = input()

a = S.count('a')
b = S.count('b')
c = S.count('c')

if max(abs(a - b), abs(b - c), abs(c - a)) >= 2:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
from itertools import combinations

# input
N, D = map(int, input().split())
X = []
append = X.append
for n in range(N):
    x = list(map(int, input().split()))
    append(x)

# check
cnt = 0
for i, j in combinations(X, 2):
    k = sum([abs(i[d] - j[d]) ** 2 for d in range(D)]) ** 0.5
    if k % 1 == 0:
        cnt += 1

print(cnt)
# Judge status: Accepted
input = input().strip().split()
a = int(input[0])
b = int(input[1])

if a % 2 == 0 or b % 2 == 0:
    print('Even')
else:
    print('Odd')
# Judge status: Wrong Answer
import math
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
for _ in range(math.ceil(math.log2(K)) + 1):
    count_list = [0] * N
    for i, v in enumerate(A_list):
        count_list[i - v if i - v > 0 else 0] += 1
        if i + v + 1 < N:
            count_list[i + v + 1] -= 1
    temp = 0
    for i in range(len(A_list)):
        temp += count_list[i]
        A_list[i] = temp

print(*A_list)
# Judge status: Accepted
def solve():
    X, Y = map(int, input().split())
    print(X+Y//2)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
a=int(input())
s=input()
print(s if a>3200 else "red")
# Judge status: Accepted
n=int(input())
fhand=n//500
n=n-500*(n//500)
five=n//5
print(fhand*1000+five*5)
# Judge status: Accepted
S=str(input())
l=len(S)
p=753
for i in range(0,l-2):
    n=int(S[i:i+3])
    p = min(p,abs(753-n))
print(p)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    h,n=map(int,input().split())
    lis=np.array([list(map(int,input().split())) for _ in range(n)])
    a_max=np.max(lis[:,0])
    dp=np.zeros(h+a_max+1,int)
    for i in range(1,h+1):
        dp[i+lis[:,0]]=np.minimum(dp[i+lis[:,0]],dp[i]+lis[:,1])
    print(dp[h])

if __name__=='__main__':
    main()
# Judge status: Accepted
N, K = map(int, input().split())
print(((N - 1) + (K - 2)) // (K - 1))
# Judge status: Accepted
import sys

def main():
    n, m, k = map(int, input().split())
    cnt = set()
    for x in range(n+1):
        for y in range(m+1):
            tmp = x*y + (n-x)*(m-y)
            if tmp not in cnt:
                cnt.add(tmp)

    if k in cnt:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = input()
str = ''
for i in n:
  if i == '0' or i == '1':
    str = str + i
  if i == 'B':
    str = str[:-1]
    
print(str)
# Judge status: Wrong Answer
import sys

A,B=input().split()
X=int(A+B)
for i in range(1,200):
  if i*i==X:
    print('Yes')
    sys.exit()
else:
  print('No')
# Judge status: Accepted
K = int(input())

done = set()
i = 0
x = 7
flag = True
while x % K != 0 :
  if not x in done :
    done.add(x)
  else :
    flag = False
    break
  x = (x % K) * 10 + 7
  i += 1
    
if flag :
  print(i + 1)
else :
  print(-1)
# Judge status: Wrong Answer
s = input()

if s[0] == s[1] or s[0] == s[2] or s[0] == s[3] or s[1] == s[2] or s[1] == s[3] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
t = 0
for i in range(n):
 for j in range(i+1,n):
  t += a[i] > a[j]
print("YES" if t < 2 else "NO")
# Judge status: Accepted
import sys
n,m = map(int,input().split())
d = [None]*n
for i in range(n):
    a,b = map(int,input().split())
    d[i] = [a,b]

d.sort(key=lambda x: x[0])

ryoukin = 0
cnt = 0
for lst in d:
    for i in range(lst[1]):
        ryoukin += lst[0]
        cnt += 1
        if cnt == m:
            print(ryoukin)
            sys.exit()
# Judge status: Wrong Answer
from collections import deque
n = int(input())
l = input().split()
d = deque()
for i in l:
    if int(i) % 2 == 1:
        d.appendleft(i)
    else:
        d.append(i)
if n % 2 == 0:
    d.reverse()
print(' '.join(d))
# Judge status: Accepted

import itertools

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

x = [a, b]
y = [c, d]

ans = []

prod = itertools.product(x,y)
for i in prod:
    ans.append(i[0]*i[1])

print(max(ans))
# Judge status: Wrong Answer
s= input()
counter=0
 
if int(len(s))<= 3:
    print(0)
    exit(0)
else:
    for i in range(1, 100):
        a = str(2019*i)
        if a in s:
            counter += 1
    print(counter)
# Judge status: Wrong Answer
import sys 
import math
try:
	sys.stdin = open('input.txt', 'r') 
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(1):
	# n = int(input())
	a,b,c,d = map(int,input().split())
	# l = list(map(int,input().split()))
	if math.ceil(a/d)==1:
		print("No")
	elif math.ceil(c/b)-1 <= math.ceil(a/d):
		print ("Yes")
	else:
		print("No")
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    N = int(input())
    cards = [int(item) for item in input().split()]

    all_sum = sum(cards)

    
    def candi_abs(sumu):
        # print(sumu, all_sum - sumu, abs(2*sumu - all_sum))
        return abs(2*sumu - all_sum)

    res = 3 * 10**9
    sumu = 0
    for i in range(N-1):
        sumu += cards[i] 
        res = min(res, candi_abs(sumu))

    print(res)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
x=int(input())
print('YES' if x in [3,5,7] else 'NO')
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

ans = a + b + c - max(a, b, c) + max(a, b, c) * 2**k
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

DP = [[0, 0] for _ in range(N+1)]
DP[0][1] = -10**15 

for i in range(N):
    for j in range(2):
        DP[i+1][0] = max(DP[i][0]+A[i], DP[i][1]-A[i])
        DP[i+1][1] = max(DP[i][0]-A[i], DP[i][1]+A[i])

print(DP[N][0])
# Judge status: Accepted
s = input()
k = int(input())

for i, v in enumerate(s):
  if i == k-1:
      print(v)
      exit()
  elif v != "1": 
      print(v)
      exit()
# Judge status: Accepted
def Level(S):
    A=[0]
    for i in range(len(S)):
        if S[i]=="(":
            A.append(A[-1]+1)
        else:
            A.append(A[-1]-1)
    return A

N=int(input())
S=input()

A=Level(S)
X=-min(A)
T="("*X+S

B=Level(T)
Y=B[-1]
U=T+")"*Y

print(U)
# Judge status: Accepted
a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
# Judge status: Accepted
l=[]
for i in range(5):l.append(int(input()))
k=int(input())
c=0
for i in l:
    for j in l:
        if abs(i-j)>k:c+=1
print('Yay!' if c==0 else ':(')
# Judge status: Accepted
s = input()
k = int(input())
f = lambda x: (ord('a') - ord(x))%26
ans = ''
for c in s:
    if k>=f(c):
        ans += 'a'
        k -= f(c)
    else:
        ans += c
ans = ans[:-1] + chr(ord('a') + (ord(ans[-1])-ord('a')+k)%26)
print(ans)
# Judge status: Accepted
from sys import stdin, stdout
t = int(stdin.readline())
if t % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
k, s = map(int, input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0 <= s-z-y <= k]))
# Judge status: Wrong Answer
a, b, t = map(int, input().split())
ans = b
c = a
if a > t:
    print(0)
    exit()
while True:
    ans += b
    c += a
    if c  > t + 1:
        ans -= b
        break
print(ans)
# Judge status: Accepted
k=int(input())
if k%2==0:
    print((k//2)**2)
else:
    print((k//2)*(k//2+1))
# Judge status: Accepted
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
        table[i] *= i
    
    return table

n = int(input())
eras = num_divisors_table(n)
  
print(sum(eras))
# Judge status: Wrong Answer
x=int(input())
ans=x//11
if x%11==0:
  print(ans)
elif x%11<=6:
  print(ans+1)
else:
  print(ans+2)
# Judge status: Accepted
N, L = map(int, input().split())
S = []
for i in range(N):
    s = input()
    S.append(s)
S = sorted(S)
print(''.join(S))
# Judge status: Accepted
import math
a,b= input().split()

gosei = int(a+b)

tekito = math.ceil(gosei)

r = 'No'
for i in range(1,tekito+1):
  if gosei % i == 0 and i == gosei // i:
    r = 'Yes'
    break
print(r)
# Judge status: Wrong Answer
w, a, b = map(int, input().split())
if a <= b:
    print(b - w + a if b - w + a > 0 else 0)
else :
    print(a - w + b if a - w + a > 0 else 0)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

def point(x):
  if x == 'r':
    return(p)
  elif x == 's':
    return(r)
  else:
    return(s)

score = 0
for i in range(n):
  score += point(t[i])
  
for i in range(k):
  a = i
  b = 1
  while a+k < n:
    if t[a] == t[a+k]:
      b += 1
    else:
      score -= point(t[a])*(b//2)
      b = 1
    a += k
  else:
    score -= point(t[a])*(b//2)
print(score)
# Judge status: Wrong Answer
w,h,x,y=map(int,input().split())

ans=(w*h)/2

if x==0 and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if x==w and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==0 and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==h and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
else:
    print(f'{ans:.06f}',end=' ')
    print('1')
# Judge status: Wrong Answer
N,M = map(int,input().split())

a = [list(map(int,input().split())) for x in range(N)]
c = [list(map(int,input().split())) for x in range(M)]

min_cpoint = 0
num_stack = 51

for i in range(N):
    for j in range(M):
        if num_stack > abs(a[i][0]-c[j][0]) + abs(a[i][1]-c[j][1]):
            num_stack = abs(a[i][0]-c[j][0]) + abs(a[i][1]-c[j][1])
            min_cpoint = j+1
    print(min_cpoint)
    min_cpoint = 0
    num_stack = 51
# Judge status: Accepted
s = int(input())
a = []
a.append(s)
def f(n):
    if n%2 ==0:
        return int(n/2)
    else:
        return 3*n+1
i = 1        
while f(a[-1]) not in a:
    a.append(f(a[-1]))
    i+=1
#print(i,a)
print(i+1)
# Judge status: Accepted
def resolve():
    n, x = map(int, input().split())
    a = list(map(int, input().split()))

    ans = []
    if a[0] <= x:
        ans.append(a[0])
    else:
        ans.append(x)
    for i in range(1,n):
        if ans[i-1] + a[i] <= x:
            ans.append(a[i])
        else:
            ans.append(x-ans[i-1])
    print(sum(a)-sum(ans))

resolve()
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(max(2*a-1,a+b))
# Judge status: Accepted
N, M = map(int, input().split())

citys = {i: 0 for i in range(1, N+1)}

for _ in range(M):
    a, b = map(int, input().split())
    citys[a] += 1
    citys[b] += 1
    
for num in citys.values():
    print(num)
# Judge status: Accepted
n = int(input())
ls = []
for i in range(n):
    x,l = map(int,input().split())
    ls.append([x-l,l+x])
    
ls = sorted(ls, key=lambda x: x[1])
ans = n

for i in range(1,n):
    if ls[i][0] < ls[i-1][1]:
      ls[i][1] = ls[i-1][1]
      ans -=1
        
print(ans)
# Judge status: Accepted
n = int(input())
def func(x):
  answer = list(map(int,str(x)))
  return sum(answer)
nums = []
for a in range(1,n):
  b = n - a
  num = func(a) + func(b)
  nums.append(num)
print(min(nums))
# Judge status: Wrong Answer
a = input()
b = input()
if (a[0] == b[2])and(b[0] == a[2]):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
from fractions import gcd


def lcm(a, b):
    return a * b / gcd(a, b)



MOD = 10 ** 9 + 7

N = int(input())
A = list(map(int, input().split()))


_lcm = 1
for a in A:
    _lcm = lcm(_lcm, a)

ans = _lcm * sum([pow(s, MOD - 2, MOD) for s in A]) % MOD

print(int(ans % MOD))
# Judge status: Accepted
N = input()
num = N.split(' ')
a = int(num[0])
b = int(num[1])
c = int(num[2])
d = int(num[3])

e = a * c
f = a * d
g = b * c
h = b * d
num_max = max([e, f, g, h])
print(num_max)
# Judge status: Accepted
N, K = map(int, input().split())
sunukes = [0 for k in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    sunukes[a-1] += 1
  assert len(A) == d
print(len([k for k in sunukes if k == 0]))
# Judge status: Wrong Answer
n = int(input())
l = list(input())
ans = 0
for i in range(n):
  l1 = l[i:]
  count = 0
  for j in range(i+1):
    if l[j] in l1:
      count += 1
  ans = max(ans,count)
  
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
X=[]
count = 0
for i in range(N):
  if A[i]%2==0 and A[i]%3!=0  or A[i]%5!=0:
    print("DENIED")
else:
  print("APPROVED")
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
ls = [list(map(int, input().split())) for i in range(q)]
d = [0]
pre = 0
c = 0

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



for start, end in ls:
    print(d[end-1]-d[start-1])
# Judge status: Wrong Answer
S = input()
Cnt = 0
result = [False]*26
for s in S:
	result[ord(s)-97] = True
for r in range(26):
	Cnt +=1
	if result[r]==False:
		break
if Cnt != 26:
	print(chr(Cnt+96))
else:
	print('None')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
D = {}
for t in a:
    if t in D:
        D[t]+=1
    else:
        D[t]=1

ans = 0
for k,v in D.items():
    if k==v:
        continue
    elif k>v:
        ans += v
    else:
        ans += v-k

print(ans)
# Judge status: Accepted
N = int(input())
x = 800*N
y = (N//15)*200
Ans = x - y
print(Ans)
# Judge status: Accepted
import math
 
r = float(input())
print(r*math.pi*2)
# Judge status: Accepted
a,b,k=map(int,input().split())
l=[]
for i in range(a,min(b+1,a+k)):
    l.append(i)
for i in range(max(a,b-k+1),b+1):
    l.append(i)
l=sorted(set(l))
for i in l:print(i)
# Judge status: Accepted
n = int(input())
s = input()
dist = 0
mlow = 0
for i in s:
    if i == ")":
        dist -= 1
        if dist < mlow:
            mlow = dist
    else:
        dist += 1

left = "("*(-mlow)
right = ")"*(dist-mlow)
print(left+s+right)
# Judge status: Accepted
a = {1, 3, 5, 7, 8, 10, 12}
b = {4, 6, 9, 11}
c = {2}
x, y = map(int, input().split())
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x in c and y in c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,k=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
  if l[i]==1:
    tmp=i
print(tmp//2+(n-tmp)//2)
# Judge status: Wrong Answer
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    B = [A[i-1] - i for i in range(1,N+1)]
    b = B[N // 2] if N%2 == 1 else round((B[N // 2 - 1] + B[N // 2]) / 2)
    print(sum([abs(bb -b) for bb in B]))
    return

if __name__ == "__main__":
    main()
# Judge status: Accepted
h = int(input())
dig=len(format(h, 'b'))
print(2**dig-1)
# Judge status: Accepted
N,K = map(int,input().split())
arr = []

for i in range(N):
  a = int(input())
  arr.append(a)
  
arr.sort()
ans = 10**10

for i in range(N-K+1):
  a = arr[i]
  b = arr[i+K-1]
  c = b-a
  ans = min(ans,c)
  
print(ans)
# Judge status: Accepted
N = int(input())
flag = False
for a in range(25):
  for b in range(14):
    if 4*a+7*b==N:
      flag = True

if flag:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,k=map(int,input().split());a=0
while n:n//=k;a+=1
print(a)
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
print('Yes' if a <= x and (a + b) >= x else 'No')
# Judge status: Accepted
N = int(input())

dpa,dpb,dpc = 0,0,0
for n in range(N):
  a,b,c = map(int, input().split())  
  dpa,dpb,dpc = max(dpb+a,dpc+a),max(dpa+b,dpc+b),max(dpa+c,dpb+c)
  
ans = max(dpa,dpb,dpc)
print(ans)
# Judge status: Accepted
k,a,b=map(int, input().split())

ans=0

if a+1>=b or k<=a:
    ans=k+1
else:
    k-=(a-1)
    ans=a
    exchange=k//2
    ans+=(b-a)*exchange

    k-=2*exchange
    ans+=k

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A.sort()
#print(A)
yesno = 'NO'
for i in range(len(A)-1):
    if A[i]==A[i+1]:
        yesno = 'YES'
        break
print(yesno)
# Judge status: Wrong Answer
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s)
  array[0] = 1
  array[2] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s-1])
# Judge status: Wrong Answer
N = int(input())
A = [[int(x) for x in input()] for _ in range(N)]
A.sort()
m1 = A[-1]
m2 = A[-2]
ANS = [m1 if x == m1 else m2 for x in A]
print('\n'.join(map(str,ANS)))
# Judge status: Wrong Answer
a, b = map(int , input().split())

if a + b % 2 == 0:
	print(a + b / 2)
else:
	print("IMPOSSIBLE")
# Judge status: Accepted
n=int(input())

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

memo = [0]*(2+10**5)

for a in t:
    memo[a-1] += 1
    memo[a] += 1
    memo[a+1] += 1
print(max(memo))
# Judge status: Accepted
a = input().split()
five = 0
seven = 0
for i in a:
    if i == "5":
        five += 1
    elif i == "7":
        seven += 1
if five == 2 and seven == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

n = int(input())

x = []
y = []
for i in range(n):
    a,b = map(int,input().split())
    x.append(a+b)
    y.append(a-b)

x.sort()
y.sort()

res = max(x[-1]-x[0],y[-1]-y[0])

print(res)
# Judge status: Accepted
import math

A, B, C = map(int, input().split())
K = int(input())

X0 = math.log2(B/A)
Y0 = math.log2(C/B)

def get_num(x):
    if x<=0:
        return int(-x) + 1
    else:
        return 0

n = get_num(X0)
Y_ = Y0 - n
m = get_num(Y_)


print("Yes" if n+m <= K else "No")
# Judge status: Accepted
s = input()

s0 = 0
s1 = 0

for c in s:
    if c == '0':
        s0 += 1
    else:
        s1 += 1

print(min(s0, s1)*2)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

minus = []
plus = []
for i in A:
    if (i < 0):
        minus.append(i)
    else:
        plus.append(i)

if (len(minus) % 2 == 0 or 0 in plus):
    # 全てを正にできる
    print(sum(plus) - sum(minus))
    exit()

# 絶対値がもっとも小さいものを探す
min_abs = 10**9 + 7
for i in A:
    min_abs = min(min_abs, abs(i))

sum_ans = 0
for i in A:
    sum_ans += abs(i)

print(sum_ans - min_abs * 2)
# Judge status: Accepted
n = int(input())
S = list(input())

w = S.count('.')
b = 0
ans = w+b

for i in range(n):
    if S[i] == '.':
        w -= 1
    else:
        b += 1
    ans = min(ans, w+b)

print(ans)
# Judge status: Accepted
N = int(input())
L = []
for n in range(N):
    L.append(str(input()))
L = sorted(L)
#print(L)
ans = 1
for i in range(N-1):
    if L[i] != L[i+1]:
        ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = [0] * N

for i in range(N - 1, -1, -1):
    tmp_sum = 0
    for j in range((i + 1) * 2 - 1, N, i + 1):
        tmp_sum += B[j]
        tmp_sum %= 2
    B[i] = tmp_sum ^ A[i]

print(sum(B))
print(*[i + 1 for i, b in enumerate(B) if b == 1])
# Judge status: Accepted
l, r, d = map(int, input().split())
ans = 0
for i in range(l, r + 1):
    if i % d == 0:
        ans += 1
print(ans)
# Judge status: Wrong Answer
a,b=input().split()
c,d=map(int,input().split())
print(c-1,d if input()==a else c,d-1)
# Judge status: Wrong Answer
import sys
s = input()
for x, y in zip(s, s[1:]):
  if x == 'h' and y == 'i':
    print('Yes')
    sys.exit()
print('No')