Harryxun/stf_run huggingface dataset:
N = int(input())
z,w = [],[]
K = 0
for i in range(N):
  x,y = map(int,input().split())
  z.append(x)
  w.append(y)
for j in range(N):
  if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]:
    K += 1

if K >= 1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
z,w = [],[]
K = 0
for i in range(N):
  x,y = map(int,input().split())
  z.append(x)
  w.append(y)
for j in range(N-2):
  if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]:
    K += 1

if K >= 1:
  print("Yes")
else:
  print("No")
import sys
from heapq import*
s=sys.stdin.readline
def g(s,g):
 F=[1e7]*-~n;F[s]=0
 H=[(0,s)]
 while H:
  c,u=heappop(H)
  if u==g:return c
  for f,v in E[u]:
   t=c+f
   if t<F[v]:F[v]=t;heappush(H,(t,v))
 return-1
for e in iter(s,'0 0'):
 n,k=map(int,e.split())
 E=[[]for _ in[0]*-~n]
 for _ in[0]*k:
  f=[*map(int,s().split())]
  if f[0]:
   c,d,e=f[1:]
   E[c]+=[(e,d)];E[d]+=[(e,c)]
  else:print(g(*f[1:]))


### FIXED CODE ###

def s():
 import sys
 r=sys.stdin.readline
 I=float('inf')
 for e in iter(r,'0 0\n'):
  n,k=map(int,e.split())
  F=[[I]*-~n for _ in[0]*-~n]
  for i in range(1,n+1):F[i][i]=0
  for _ in[0]*k:
   f=r();g=map(int,f[2:].split())
   if'0'==f[0]:a,b=g;A=F[a][b];print([A,-1][A==I])
   else:
    c,d,e=g
    if e<F[c][d]:
     for i in range(2,n+1):
      for j in range(1,i):
       F[i][j]=F[j][i]=min(F[i][j],F[i][c]+e+F[d][j],F[i][d]+e+F[c][j])
s()
num = map(int, input().split())
num = sorted(num, reverce = True)
print(num[0]*10 + num[1] + num[2])

### FIXED CODE ###

num = map(int, input().split())
num = sorted(num, reverse = True)
print(num[0]*10 + num[1] + num[2])
import sys
input = sys.stdin.buffer.readline
from collections import Counter
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a = [i - 1 for i in a]
    ac = Counter(a)
    kaiten = [0] * n
    count = 0
    koko = 0
    kaitenkikan = 0
    while k > 0:
        koko = a[koko]
        count += 1
        k -= 1
        if kaiten[koko] > 0:
            kaitenkikan = count - kaiten[koko]
            break
        else:
            kaiten[koko] = count
    k_remain = k % kaitenkikan

    while k_remain > 0:
        koko = a[koko]
        k_remain -= 1

    print(koko + 1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n, k = map(int, input().split())
    a = [0]
    ta = list(map(int, input().split()))
    a += ta
    kaiten = [0] * (n + 1)
    count = 0
    koko = 1
    kaitenkikan = 0
    while k > 0:
        koko = a[koko]
        count += 1
        k -= 1
        if kaiten[koko] > 0:
            kaitenkikan = abs(count - kaiten[koko])
            break
        else:
            kaiten[koko] = count
    if k == 0:
        print(koko)
        sys.exit()
    k_remain = k % kaitenkikan
    if k_remain < 0:
        k_remain += kaitenkikan

    while k_remain > 0:
        koko = a[koko]
        k_remain -= 1

    print(koko)

if __name__ == '__main__':
    main()
n = int(input());
s = input();

ans = 0;

for i in range(len(s)):
  3_str = s[i:i+2];
  ans += int(3_str == "ABC");

print(ans);

### FIXED CODE ###

n = int(input());
s = input();

ans = 0;

for i in range(n):
  three = s[i:i+3];
  ans += int(three == "ABC");

print(ans);
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
import math
 
if ((math.sqrt(a/(c)**2) + math.sqrt(b/(c)**2)) < 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if 4 * a * b < (c - a- b)**2 and c - a- b > 0:
    print("Yes")
else:
    print("No")
def main():
    from builtins import abs
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
 
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
    print(dp[N - 1])
 
 
main()

### FIXED CODE ###

def jump(i):
    memo[0] = 0
    memo[1] = abs(arr[1]- arr[0])               
    for i in range(2, n):
        memo[i] = min(memo[i-1] + abs(arr[i-1]- arr[i]) ,
                      memo[i-2] + abs(arr[i-2]- arr[i]))
    return memo[-1]    

n = int(input())
arr = list(map(int, input().split()))
memo = [-1] * n 
                   
result = jump(n)
print(result)
import bisect


n, k = map(int, input().split())
xs = list(map(int, input().split()))
index = bisect.bisect_right(xs, -1)

a = xs[:index][::-1]
cost = 0
if xs[index] == 0:
    cost += 1
    b = xs[index + 1:]
else:
    b = xs[index:]

cost_a = [0]
cost_b = [0]
for c in a:
    cost_a.append(abs(c))
for c in b:
    cost_b.append(c)

ret = float('inf')
if len(a) >= k - cost:
    ret = min(ret, cost_a[k - cost])
if len(b) >= k - cost:
    ret = min(ret, cost_b[k - cost])

for i in range(len(cost_a)):
    if 0 <= k - i < len(cost_b):
        ret = min(ret, 2 * cost_a[i] + cost_b[k - i])

for i in range(len(cost_b)):
    if 0 <= k - i < len(cost_a):
        ret = min(ret, 2 * cost_b[i] + cost_a[k - i])
print(ret)


### FIXED CODE ###

import bisect


n, k = map(int, input().split())
xs = list(map(int, input().split()))
index = bisect.bisect_right(xs, -1)

a = xs[:index][::-1]
cost = 0
if index < len(xs) and xs[index] == 0:
    cost += 1
    b = xs[index + 1:]
else:
    b = xs[index:]

cost_a = [0]
cost_b = [0]
for c in a:
    cost_a.append(abs(c))
for c in b:
    cost_b.append(c)

ret = float('inf')
if len(a) >= k - cost:
    ret = min(ret, cost_a[k - cost])
if len(b) >= k - cost:
    ret = min(ret, cost_b[k - cost])

for i in range(len(cost_a)):
    if 0 <= k - i < len(cost_b):
        ret = min(ret, 2 * cost_a[i] + cost_b[k - i])

for i in range(len(cost_b)):
    if 0 <= k - i < len(cost_a):
        ret = min(ret, 2 * cost_b[i] + cost_a[k - i])
print(ret)
2 2 1 1


### FIXED CODE ###

w, h, x, y = list(map(int, input().split()))
print(w * h / 2, 1 if (w==x*2) and (h==y*2) else 0)
n = int(input())
h = list(map(int, input().split()))
count = 0
max_list = []
for i in range(len(h)-1):
    if h[i] >= h[i+1]:
        count += 1
        if i == len(h)-2:
            max_list.append(count)
    else:
        max_list.append(count)
        count = 0
print(max(max_list))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
count = 0
max_list = []
for i in range(len(h)-1):
    if h[i] >= h[i+1]:
        count += 1
        if i == len(h)-2:
            max_list.append(count)
    else:
        max_list.append(count)
        count = 0
if n == 1:
    print(0)
else:        
    print(max(max_list))
K,N = map(int,input().split())
A = []
for i in range(N):
  A.append(int(input()))
A_m=[]

for i in range(1,N):
    A_m.append(int(A[i] - A[i-1]))
  

if abs(A[N-1]-A[0]) > 10:
  A_m.append(A[0]-A[N-1] +20)
else:
  A_m.append(A[N-1]-A[0])
  
X = sum(A_m) - max(A_m)

print(X)

### FIXED CODE ###

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

  
A_m = []
 
for i in range(1,N):
  A_m.append(A[i]-A[i-1])
  
A_m.append(K-A[N-1]+A[0])
  
print(sum(A_m)-max(A_m))
a = input()
my_result = a + a**2 + a**3
print(my_result)

### FIXED CODE ###

a = int(input())
my_result = a + a**2 + a**3
print(my_result)
A, B, K = map(int, raw_input().split())
AB = range(A, B + 1)
if B - A + 1 > 2 * K:
	for i in AB[:K]:
		print i
	for i in AB[-K:]:
		print i
else:
	for i in AB:
		print i


### FIXED CODE ###

A, B, K = map(int, raw_input().split())
if B - A + 1 > 2 * K:
	for i in range(A, A + K):
		print i
	for i in range(B - K + 1, B + 1):
		print i
else:
	for i in range(A, B + 1):
		print i
import itertools
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
Ans = 0


def xor(x, y):
    X = bin(max(x, y))
    Y = bin(min(x, y))
    w = int(X) ^ int(Y)

    return int(w, 2)


for i in itertools.combinations(a, 2):
    Ans = Ans + xor(i[0], i[1])

print(Ans % mod)


### FIXED CODE ###

def powmod(x, y, mod):
    if y == 0:
        return 1
    return (((powmod(x, y >> 1, mod) ** 2) % mod) * x ** (y & 1)) % mod


n = int(input())
a = tuple(map(int, input().split()))
mod = 10**9 + 7
cnt = [0] * 60
for i in range(n):
    r = a[i]
    for j in range(60):
        if r & 1:
            cnt[j] += 1
        r >>= 1

ans = 0
for i in range(60):
    ans += powmod(2, i, mod) * cnt[i] * (n-cnt[i])
    ans %= mod
print(ans)
n=int(raw_input())
a=[0]*n
sum=0
for i in range(n):
 a[i]= int(raw_input())
 sum=sum+a[i]
a.sort()

print'a[0],a[n-1],sum'

### FIXED CODE ###

int(input())
x=map(int,raw_input().split())
print min(x),max(x),sum(x)
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  int x[N], y[M];
  for (int i = 0; i < N; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < M; ++i) {
    cin >> y[i];
  }
  for (int i = 0; i < N; ++i) {
    if (X < x[i]) X = x[i];
  }
  for (int i = 0; i < M; ++i) {
    if (Y > y[i]) Y = y[i];
  }
  if (X < Y) {
    cout << "No war" << "\n";
  }
  else {
    cout << "War" << "\n";
  }

  return 0;
}

### FIXED CODE ###

N, M, X, Y = map( int, input().split())
x = max( list( map( int, input().split())))
y = min( list( map( int, input().split())))
if max(x, X)+1 <= min( y, Y):
    print('No War')
else:
    print('War')
from collections import deque

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

tree=[[] for i in range(n)]
for i in range(n-1):
 i,j=map(int,input().split())
 tree[i-1].append(j-1)
 tree[j-1].append(i-1)

t_cnt=[0 for i in range(n)]
for i in range(q):
 p,x=map(int,input().split())
 t_cnt[p-1]+=x

cnt=[-1]*n
cnt[0]=t_cnt[0]

#seen=([0])
seen=[0]

dq=deque()
dq.append(0)

while dq:
 x=dq.popleft()
 for i in tree[x]:
#  if cnt[i]==-1:
   if i in seen:
    continue
   else:
    seen.add(i)
    dq.append(i)
    cnt[i]=cnt[x]+t_cnt[i]

print(*cnt)

### FIXED CODE ###

from collections import deque

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

tree=[[] for i in range(n)]
for i in range(n-1):
 i,j=map(int,input().split())
 tree[i-1].append(j-1)
 tree[j-1].append(i-1)

t_cnt=[0 for i in range(n)]
for i in range(q):
 p,x=map(int,input().split())
 t_cnt[p-1]+=x

cnt=[-1]*n
cnt[0]=t_cnt[0]

seen=set([0])

dq=deque()
dq.append(0)

while dq:
 x=dq.popleft()
 for i in tree[x]:
#  if cnt[i]==-1:
   if i in seen:
    continue
   else:
    seen.add(i)
    dq.append(i)
    cnt[i]=cnt[x]+t_cnt[i]

print(*cnt)
from collections import defaultdict
from math import gcd

n = int(input())
L = []
for i in range(n):
    l = list(map(int, input().split()))
    L.append(l)

Mod = 10 ** 9 + 7

Pow2 = [1]
for i in range(n):
    Pow2.append(Pow2[-1]*2)

def kikaku(a, b):
    g = gcd(a, b)
    a //= g
    b //= g
    if a < 0:
        return - a, -b
    return a, b

Dpos = defaultdict(int)
Dneg = defaultdict(int)

c = 0
for l in L:
    a, b = kikaku(l[0], l[1])
    if a == b == 0:
        c += 1
    elif b > 0:
        Dpos[(b, -a)] += 1
        Dneg[(b, -a)] += 0
    else:
        Dpos[(a, b)] += 0
        Dneg[(a, b)] += 1

r = 1
for k, v in Dpos.items():
    j = Dneg[k]
    if v > 0 and j > 0:
        r = r * (Pow2[v] + Pow2[j] - 1) % Mod
#    elif v == 0 and j == 0:
#        pass
    else:
        r = r * 2 % Mod 
ans = (r + c - 1) % Mod
print(ans)

### FIXED CODE ###

from collections import defaultdict
from math import gcd

MOD=10**9+7

n=int(input())
L=[]
for i in range(n):
	l=list(map(int,input().split()))
	L.append(l)

def kikaku(a,b):
	g=gcd(a,b)
	a//=g
	b//=g
	if a<0:
		return -a,-b
	return a,b
#aもbも正の場合Dposでカウント。
Dpos=defaultdict(int)
#aが正bが負の場合Dnegでカウント。
Dneg=defaultdict(int)

zerozero=0
azero=0
bzero=0

for l in L:
	a=l[0]
	b=l[1]
	if a==b==0:
		zerozero+=1
		continue
	if a==0:
		azero+=1
		continue
	if b==0:
		bzero+=1
		continue
	a,b=kikaku(a,b)
	if b>0:
		Dpos[(a,b)]+=1
	else:
		Dneg[(a,-b)]+=1
		Dpos[(-b,a)]+=0

r=1
for k,v in Dpos.items():
	a,b=k
	j=Dneg[(b,a)]
	r*=pow(2,v,MOD)+pow(2,j,MOD)-1
	#print(a,b,v,j,r)
	r%=MOD

r*=pow(2,azero,MOD)+pow(2,bzero,MOD)-1
r%=MOD
r-=1
r%=MOD

ans=r+zerozero
ans%=MOD
print(ans)
#print(Dpos)
#print(Dneg)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = [""] * L
for i in range(N):
    idx = i * (L // N)
    # x[idx] = S[i]
    print(x[idx])
for i in range(M):
    idx = i * (L // M)
    if x[idx] != "" and x[idx] != T[i]:
        print(-1)
        exit()
print(L)


### FIXED CODE ###

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = {}
for i in range(N):
    idx = i * (L // N)
    x[idx] = S[i]
for i in range(M):
    idx = i * (L // M)
    if idx in x and x[idx] != T[i]:
        print(-1)
        exit()
print(L)
import math


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

bc=[]

for i in range(m):
    l,r=list(map(int, input().split()))
    bc.append([l,r])
    
list.sort(a)
list.sort(bc, key=lambda x:x[0])

count=0

for i in range(m):
    for j in range(min(bc[m-i-1][0],len(a))):
        if(a[count]<bc[m-i-1][1]):
            a[count]=bc[m-i-1][1]
            count+=1

print(sum(a))

### FIXED CODE ###

import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

#a = list(map(int, input().split()))

n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
bc=[]
for i in range(m):
    temp=list(map(int, input().split()))
    bc.append(temp)

a.sort()

bc.sort(key=lambda x:x[1],reverse=True)
#print(a)
#print(bc)

now=0
for i in range(n):
    if(a[i] < bc[now][1]):
        a[i] = bc[now][1]
        bc[now][0] -= 1
    else:
        break
    if(bc[now][0]==0):
        now+=1
    if(now>=m):
        break
    
print(sum(a))
#print(a)
A,B = map(int, input().split())
S = list(input())
if A+B+1-S != 0:
    print("No")
    exit()
for i in range(len(S)):
    if (ord(S[i]) < ord("0") or ord(S[i]) > ord("9")) ^ i == A:
        print("No")
        exit()
print("Yes")


### FIXED CODE ###

A,B = map(int, input().split())
S = list(input())
ans = len(S) == A+B+1 and S[A] == '-' and S.count('-') == 1
print(["No", "Yes"][ans])
import copy 

def gcd(a,b):
    if b > a:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a

N = int(input())
T = list(map(int,input().split()))
T.sort()
LIS = [0]*N
LIS[0] += T[0]
for i in range(N-1):
    LIS[i+1] += gcd(LIS[i],T[i+1])
GCD = 0
GCD += LIS[N-1]
#第１項がtarget
S = copy.copy(T)
S.pop(0)
LS = [0]*(N-1)
LS[0] += S[0]
for i in range(N-2):
    LS[i+1] += gcd(LS[i],S[i+1])
ANSA = LS[N-2]

#その他の場合
LJ = []
for i in range(N-1):
    if LIS[i] != LIS[i+1]:
        LJ.append(i+1)

LK = []
for j in range(len(LJ)):
    U = copy.copy(T)
    U.pop(LJ[j])
    LS = [0]*(N-1)
    LS[0] += U[0]
    for i in range(N-2):
        LS[i+1] += gcd(LS[i],S[i+1])
    LK.append(LS[N-2])
ANSB = max(LK)

print(max(ANSA,ANSB))

### FIXED CODE ###

import copy 

def gcd(a,b):
    if b > a:
        a, b = b, a
    while b:
        a, b = b, a%b
    return a

N = int(input())
T = list(map(int,input().split()))
T.sort()
LIS = [0]*N
LIS[0] += T[0]
for i in range(N-1):
    LIS[i+1] += gcd(LIS[i],T[i+1])
F = LIS.index(min(LIS))
if len(T) == 2:
    ANS = max(T[0],T[1])
elif F == 0:
    U = copy.copy(T)
    V = copy.copy(T)
    U.pop(1)
    V.pop(0)
    LU = [0]*(N-1)
    LU[0] = U[0]
    LV = [0]*(N-1)
    LV[0] = V[0]
    for i in range(N-2):
        LU[i+1] += gcd(LU[i],U[i+1])
    ANSU = LU[N-2]
    for i in range(N-2):
        LV[i+1] += gcd(LV[i],V[i+1])
    ANSV = LV[N-2]
    ANS = max(ANSU,ANSV)
    
else:
    U = copy.copy(T)
    V = copy.copy(T)
    U.pop(F)
    V.pop(0)
    LU = [0]*(N-1)
    LU[0] = U[0]
    LV = [0]*(N-1)
    LV[0] = V[0]
    ANSU = 0
    ANSV = 0
    for i in range(N-2):
        LU[i+1] += gcd(LU[i],U[i+1])
    ANSU = LU[N-2]
    for i in range(N-2):
        LV[i+1] += gcd(LV[i],V[i+1])
    ANSV = LV[N-2]
    ANSP = max(ANSU,ANSV)
    ANS = max(ANSP,LIS[N-1])
        
print(ANS)
a=atr(input())

if a=="A":
    print("T")
if a=="T":
    print("A")
if a=="G":
    print("C")
if a=="C":
    print("G")

### FIXED CODE ###

a=str(input())
 
if a=="A":
    print("T")
if a=="T":
    print("A")
if a=="G":
    print("C")
if a=="C":
    print("G")
def dis(xa,ya):
  return abs(xa - 1) + abs(ya - 1)

n = int(input())
ans = 2*n
i = 1
while i*i <= n:
	if (n % i == 0):
      ans = min(ans,dis(i,n//i))
    i += 1
print(ans)

### FIXED CODE ###

def dis(xa,ya):
    return abs(xa - 1) + abs(ya - 1)

n = int(input())
ans = 2*n
i = 1
while i*i <= n:
    if (n % i == 0):
        ans = min(ans, dis(i,n//i))
    i += 1
print(ans)
s = input()
t = input()

if t = (s + 1):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
t = input()

if s == t[:-1]:
    print('Yes')
else:
    print('No')
n = int(input())
anagram =[]
ans = 0
for _ in range(n):
    s = ''.join(input())
    anagram.append(s)
count_ana = Counter(anagram)
for v in count_ana.values():
    ans += v * (v + 1) // 2
print(ans)

### FIXED CODE ###

from collections import Counter 
n = int(input())
anagram =[]
ans = 0
for _ in range(n):
    s = ''.join(sorted(input()))
    anagram.append(s)
count_ana = Counter(anagram)
for v in count_ana.values():
    ans += v * (v - 1) // 2
print(ans)
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]
count = 0

for i in a:
    lis[int(i - 1)] += 1

for i in lis:
    print("{}".format(i))

### FIXED CODE ###

#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]

for i in a:
    lis[int(i) - 1] += 1

for i in lis:
    print("{}".format(i))
a,b,c = map(int,input().split())

if a == b and b == c and c == a:
    print(-1)
else:
    for i in range(10**9):
        ans = i
        if a % 2 ==1:
            break
        else:
            a = b/2 + c/2
        if b % 2 == 1:
            break
        else:
            b = c/2 + a/2
        if c % 2 == 1:
            break
        else:
            c = a/2 + b/2
print(ans)

### FIXED CODE ###

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

if a%2 == 1 or b%2 == 1 or c%2==1:
    print(0)
elif a==b and b==c and c==a:
    print(-1)
else:
    for i in range(10**9):
        ans = i
        if a % 2 == 1:
            break
        else:
            tmpa = b/2 + c/2
        if b % 2 == 1:
            break
        else:
            tmpb = c/2 + a/2
        if c % 2 == 1:
            break
        else:
            tmpc = a/2 + b/2
        a = tmpa
        b = tmpb
        c = tmpc
    print(ans)
N,A=map(int,input().split())
cards=list(map(int,input().split()))

result=0

for i in range(2**N):
    list2 =[]
    for j in range(N):
        if (i >> j) &1 == 1:
            list2.append(cards[j])
    if len(list2)!=0:
        ave =sum(list2)/len(list2)
        if ave==A:
            result+=1

print(result)

### FIXED CODE ###

N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N>=K:
    print(X*K + Y*(N-K))
else:
    print(X*N)
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
ans = int(2 ** (n / 2) % (10 ** 9 + 7)) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % (10 ** 9 + 7))
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)

### FIXED CODE ###

def pow_mod(n, k, m):
    if k == 0:
        return 1
    if k & 1:
        return (pow_mod(n, k - 1, m) * n % m) % m
    else:
        return (pow_mod(n, k // 2, m) ** 2) % m

n = int(input())
aaa = list(map(int, input().split()))
mod = 10 ** 9 + 7
aaa.sort()
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, (n // 2), mod))
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, ((n - 1) // 2), mod))
n = input ()
N = int(n)
if 7 in N:
    print(yes)
else:
    print(no)


### FIXED CODE ###

n = input()
N = str(n)
if "7" in N:
    print("Yes")
else:
    print("No")
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]

aSet=set(a)
if len(a) == len(aSet):
    print("YES")
else:
    print("NO")
a, b, c, d = list(map(int, input().split()))
if math.ceil(c/b) > math.ceil(a/d):
    print('No')
else:
    print('Yes')



### FIXED CODE ###

import math
a, b, c, d = list(map(int, input().split()))
if math.ceil(c/b) > math.ceil(a/d):
    print('No')
else:
    print('Yes')
a,b=map(int,input().split())
s=0
s += b
s += a*(10**len(b))
for i in range(320):
    if s==i*i:
        print(i)
        exit()


### FIXED CODE ###

a,b=input().split()
s=0
s += int(b)
s += int(a)*(10**len(b))
for i in range(320):
    if s==i*i:
        print('Yes')
        exit()
print('No')
#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])

### FIXED CODE ###

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        preH=Calc_H(Cxi,Cyj,px[0],py[0],ph[0])
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])
        break
S = int(input())
if S = "ABC":
  print("ARC")
else":
  print("ABC")



### FIXED CODE ###

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")
n, k = map(int, input().split())
p = list(map(int, input().split()))

p_mx=0

for i in range(k):
    p_sm += p[i]

p_mx=p_sm

for i in range(n-k):
    p_sm= p_sm + p[k+i]-p[i]
    if p_sm >p_mx:
        p_mx = p_sm

print((p_mx+k)/2)

### FIXED CODE ###

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

p_sm=0

for i in range(k):
    p_sm += p[i]

p_mx=p_sm

for i in range(n-k):
    p_sm= p_sm + p[k+i]-p[i]
    if p_sm >p_mx:
        p_mx = p_sm

print((p_mx+k)/2)