peterverebics/CodeNet_Python_118 huggingface dataset:
n=int(input())
count=0
for i in range(n):
  me1,me2=list(map(int,input().split()))
  if me1==me2:
    count+=1
if count==n:
  print('Yes')
else:
  print('No')
N = int(input())
D1 = [0]*N
D2 = [0]*N
for i in range(N):
    D1[i],D2[i] = input().split()
flg = False
for i in range(N-3):
    if D1[i]==D2[i] and D1[i+1] == D2[i+1] and D1[i+2] == D2[i+2]:
        flg = True
if flg:
    print("Yes")
else:
    print("No")
n = int(input())
s = 0
for i in range(n):
  a, b = map(int, input().split())
  if a == b:
    s += 1
  else:
    s = 0
print("Yes" if s >= 3 else "No")
N = int(input(""))
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]
for a in range(N):
  if x[a] == y[a]:
    print("Yes")
    e = 1
    break
  else:
    e = 0
if e == 0:
  print("No")
n = int(input())
li = [list(map(int,input().split())) for _ in range(n)]
c = 0
ans = 0
for a,b in li:
    if a==b:
        c+=1
        ans = max(c,ans)
    else:
        ans = max(c,ans)
        print(ans)
        c=0
if ans >= 3:print('Yes')
else:print('No')
num = int(input())
ll = []
lll = []
for i in range(num):
    d1,d2 = list(map(int,input().split()))
    if d1 == d2:
        ll.append([i,d1,d2])
    else:
        pass
count = 0
for k in range(len(ll)):
    lll.append(ll[k][0])
for l in lll:
    for m in range(len(lll)+1):
        if l==m:
            count +=1
            break
if count>1:
    print('Yes')
else:
    print('No')
N = int(input())
flug = False
cnt = 0
for _ in range(N):
    D1, D2 = list(map(int, input().split())) 
    if D1 == D2:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        flug = True
if flug:
    print("YES")
else:
    print("NO")
n=int(input())
c=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
  else:
    c=0
if c>2:
  print("Yes")
else:
  print("No")
#print(c)
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    if(j>0):
      j += 1
  else:
    j=0
  if(j>=3):
    ans = "Yes"
print(ans)
import itertools
n = int(input())
count = 0

line = [input().split() for i in range(n)]
line = list(itertools.chain.from_iterable(line))

for j in range(len(line)-3):
    if line[j] == line[j+1]:
        if line[j+2] == line[j]:
            count += 1
            print('Yes')
    else:
        continue
    
if count == 0:
    print('No')
def judge():
    count = 0
    for _ in range(x):
        d1, d2 = map(int, input().split())
        print(d1, d2)
        if d1 == d2:
            count += 1
        else:
            count = 0
        
        if count == 3:
            return True

    return False

x = int(input())

if judge():
    print("yes")
else:
    print("no")
print('NYoe s'[[*'000']in[str(eval(t.replace(*' -')))for t in open(0)]::2])
n = int(input())
d = [input().split(" ") for _ in range(n)]

f = False
for i in range(n-2):
    if d[i][0] == d[i][1] and not f :
        print(d[i+1], d[i+2])
        if d[i+1][0] == d[i+1][1] and d[i+2][0] == d[i+2][1]:
            f = True
if f:
    print("Yes")
else:
    print("No")
N = int(input())

count = 0

for i in range(N):
    k, t = map(int, input().split())
    if count == 3:
      print ( "Yes" )
     
      break
      
    if not k == t:
        count *= 0
    if k == t:
       count += 1 
if count == 3:
        print ("Yes")
else:
  print ("No")
N=int(input())
count=0
lst=[]
for i in range(N):
    x,y=map(int,input().split())
    # l=[]
    # l.append(x)
    # l.append(y)
    # lst.append(l)
    if x==y:
        count+=1
    if x!=y:
        continue
        count=0
if count>=3:
    print("Yes")
else:
    print("No")
def main():
    N = int(input())
    z = 0
    for i in range(N):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            z += 1
        else:
            z = 0
        if z >= 3:
            return True

    return False

# print("Yes" if main() else "No")
print(main())
n = int(input())
d = []
for _ in range(n):
    d.append(list(map(int, input().split())))

cnt = 0
for i in d:
    if cnt >= 3:
        print('Yes')
        exit()
    if i[0] == i[1]:
        cnt += 1
    else:
        cnt = 0

print('No')
N=int(input())
p=False
s=0
for i in range(N):
  a,b=map(int,input().split())
  if a==b:
    s+=1
    if s==3:
      break
  else:
    s=0
print("Yes" if p else "No")
a=int(input())
b=0
xy = [map(int, input().split()) for _ in range(a)]
x, y = [list(i) for i in zip(*xy)]
for i in range(a-2):
  if y[i]==y[i+1]==y[i+2]:
    b=b+1
if b==0:
  print("No")
else:
  print("Yes")
N = int(input())
count = 0
for i in range(N-1):
    a, b = list(map(int, input().split()))
    if a == b:
        count += 1
if count >= 3:
  print("Yes")
else:
  print("No")
n = int(input())
a = []
for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        a.append(True)
    else:
        a.append(False)
for i in a[:-2]:
    if i == True:
        if a[a.index(i)+1] and a[a.index(i)+2]:
            print("Yes")
            exit()
print("No")
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
    else:
        max_yes = sub_yes
        sub_yes = 0
if max_yes >= 3:
    print("yes")
else:
    print("no")
N=int(input())
T=False
k=0
for i in range(N):
    D1,D2=map(int,input().split())
    if D1==D2:
        k+=1
        if k>=3:
            T=True
    else:
        k=0
    print(k)
if T:
    print("Yes")
else:
    print("No")
def readInt():
    return int(input())
def readList():
    return list(map(int,input().split()))
def readMap():
	return map(int,input().split())
def readStr():
    return input()
inf=float('inf')
mod = 10**9+7
import math
def solve(n,A):
    count=0
    for x,y in A:
        if x==y:
            count+=1
        else:
            count=0
        if count==3:
            return True
    return False

n=readInt()
A=[]
for _ in range(n):
    A.append(readList())
if solve(n,A):
    print("YES")
else:
    print("NO")
N=input()
n=int(N)
x=0
for s in range(n):
  ds1,ds2=input().split()
  if ds1==ds2:
    x+=1
  else:
    x==0
  if x==3:
    print("Yes")
    break
else:
  print("No")
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]

c = 0

for d in D:
    if d[0] == d[1]:
        c += 1
if c>=3:
    print('Yes')    
else:
    print('No')
N=int(input())
d1=[0]*N
d2=[0]*N
for i in range(N):
    d1[i],d2[i]=list(map(int,input().split()))
counter=0
for i in range(N-3):
    if d1[i]==d2[i] and d1[i+1]==d2[i+1] and d1[i+1]==d2[i+1]:
        counter=1
if counter==1:
    print('Yes')
else:
    print('No')
s = int(input())
ok = 0
c = 1
for _ in range(s):
  x,y = list(map(int,input().split()))
  
  if x==y:
    c+=1
    
  else:
    c=0
    
  if c==3:
    ok = 1
    
if ok==1:
  print('Yes')
else:
  print('No')
n = int(input())  
num_list = []
for i in range(n):
    num_list.append(list(map(int,input().split())))

ans = []
for i in range(n):
  a = num_list[i]
  a1= a[0]
  a2 = a[1]
  if a1 == a2:
    ans.append(1)
    if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1:
      print('Yes')
      break
  else:
    ans.append(0)
if len(ans) == n:
  print('No')
t=0
for _ in range(int(input())):
    d1,d2=input().split()
    d1=int(d1)
    d2=int(d2)
    if d1==d2:
        t+=1
if t>=3:
    print('Yes')
else:
    print('No')
import numpy as np
n=int(input())
lst=[]
for _ in range(n):
    lst.append(list(map(int,input().split())))
lst=np.array(lst).reshape(n,2)
for i in range(n-3):
    if all([lst[i][0]==lst[i][1],lst[i+1][0]==lst[i+1][1],lst[i+2][0]==lst[i+2][1]]):
        print("Yes")
        break
else:
    print("No")
N = int(input())
j = 0
if N >= 3:
    for i in range(0, N):
        D = str(input())
        D = D[0::2]
        if D[0] == D[1]:
            j += 1

    if j == 3:
        print("Yes")
    elif j == 6:
        print("Yes")
    elif j != 3:
        print("No")
    else:
        print("No")
def main():
    N = int(input())
    zoro = []

    for i in range(N):
        a, b = map(int, input().split())
        if a == b:
            zoro.append(1)
            if i >= 3:
                if zoro[i-2] == zoro[i-1] and zoro[i-1] == zoro[i]:
                    print('Yes')
                    return
        else:
            zoro.append(0)

    print('No')


main()
n = int(input())

d12 = [map(int, input().split()) for _ in range(n)]
d1, d2 = [list(i) for i in zip(*d12)]

for i in range(n-2):
  if d1[i] == d2[i]:
    if d1[i+1] == d2[i+1]:
      if d1[i+2] == d2[i+2]:
        print("YES")
        break
else:
  print("NO")
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
    else:
        if sub_yes > max_yes:
            max_yes = sub_yes
        sub_yes = 0

if sub_yes > max_yes:
    max_yes = sub_yes
if max_yes >= 3:
    print("yes")
else:
    print("no")
n = int(input())
flag= True
count = 0
for i in range(n):
  a,b = list(map(int, input().split()))
  if a==b:
    count += 1
  else:
    count= 0
  if count==3:
    flag = True
if flag:
  print("yes")
else:
  print("No")
N = int(input())
l = []
m = []
for i in range(N):
    a,b = map(int,input().split())
    l.append(a)
    m.append(b)
flg = 0
c = 0
for i in range(len(l)):

    if l[i] == m[i]:
        c += 1
        if c==2:
            flg += 1
            
    else:
        c = 0
if flg == 0:
    print("No")
else:
    print("Yes")
N = int(input())
flg = False
count = 0
for i in range(N):
  D1,D2 =  map(int, input().split())

  if D1 == D2:
    count += 1
    if count >= 3:
      flg = True
      break
    else:
      count = 0

if flg:
  print('Yes')
else:
  print('No')
N = int(input())
x=[0]*N
y=[0]*N
L=[0]*N

flag = "No"

if N <3:
  flag = "No"

else:

  for i in range(N):
      x[i],y[i] = map(int, input().split())

  for i in range(N):
    if x[i]==y[i]:
      L[i]=1

  #print(L)

  for i in range (N-2):
    #print(i)
    if L[i] == L[i+1] == L[i+2]:
      flag = "Yes"



print(flag)
from sys import exit
N = int(input())
 
cnt = 0
for i in range(N):
    x,y = map(int,input().split())
    if cnt == 3:
        print("Yes")
        exit(0)
    if x == y:
        cnt += 1
    else:
        cnt = 0

if cnt == 3:
    print("Yes")
    
print("No")
n = int(input())

affilé = 0

for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé == 0
  

  if affilé == 3:
    print('YES')
    exit()

  print('NO')
n=int(input())
count = 0
last = 0
for a in range(n):
    z = list(input().split())
    if int(z[0]) == int(z[1]):
        count+=1
        if count >= 3:
            last = 1
    if int(z[0]) != int(z[1]):
        if count > 0:
            count = 0
        else:
            continue
if last == 1:
    print("yes")
if last == 0:
    print("no")
n = int(input())
ans = 0
tmp = 0
for _ in range(n):
  a,b = map(int,input().split())
  if a==b:
    tmp += 1
  else:
    ans = max(ans,tmp)
    tmp = 0
print('Yes' if ans>=3 else 'No')
n = int(input())
d = [input().split(" ") for _ in range(n)]

for i in range(n-2):
    if d[i][0] == d[i][1]:
        if d[i+1][0] == d[i][1] and d[i+2][0] == d[i+2][1]:
            print("Yes")
print("No")
n = int(input())
str_list = [list(input().split()) for _ in range(n)]
print(str_list)
ans = 0
for i in range(n-2):
    if str_list[i][0] == str_list[i][1]:
        if str_list[i+1][0] == str_list[i+1][1]:
            if str_list[i+2][0] == str_list[i+2][1]:
                ans += 1
    
if ans:
    print('Yes')
else:
    print('No')
num = int(input())
ll = []
lll = []
for i in range(num):
    d1,d2 = list(map(int,input().split()))
    if d1 == d2:
        ll.append([i,d1,d2])
    else:
        pass
count = 0
for k in range(len(ll)):
    lll.append(ll[k][0])
for l in lll:
    for m in range(len(lll)+1):
        if l==m:
            count +=1
            break
if count>1:
    print('Yes')
else:
    print('No')
print(lll)
n = int(input())
cnt = 0
for i in range(n):
    x,y =map(int,input().split())
    if cnt == 3:
        print('Yes')
        exit()
    if x == y:
        cnt +=1
    else:
        cnt = 0
print('No')
n = int(input())
count = 0
for i in range(n):
  d1, d2 = map(int, input().split())
  if count == 3:
    break
  elif d1 == d2:
    count += 1
  else:
    count == 0
if count == 3:
  print("Yes")
else:
  print("No")
n = int(input())
count = 0
okay = False
for i in range(n):
  temp1, temp2 = map(int,input().split())
  if count >= 3:
    okay = True
    break
  if temp1 == temp2:
    count += 1
  else:
    count = 0

if okay == True:
  print("Yes")
else:
  print("No")
import random

exit = False

count = 0

randomArray1 = random.randint(1,6)
randomArray2 = random.randint(1,6)

while exit == False:

    randomArray1 = random.randint(1,6)
    randomArray2 = random.randint(1,6)

    print(randomArray1,randomArray2)

    count += 1

    if randomArray1 == randomArray2:
        print(count)
        exit = True

print("END")
n = int(input())  
num_list = []
for i in range(n):
    num_list.append(list(map(int,input().split())))

ans = []
for i in range(n):
  a = num_list[i]
  a1= a[0]
  a2 = a[1]
  if a1 == a2:
    ans.append(1)
    if i > 1 and ans[i-2] == 1 and ans[i-1] == 1 and ans[i] == 1:
      print('Yes')
      break
  else:
    ans.append(0)
if 0 in ans :
  print('No')
N = int(input())
count = 0
for i in range(N-1):
  s = list(map(int, input().split()))
  if s[0] == s[1]:
    count += 1
if count >= 3:
  print("Yes")
else:
  print("No")
n = int(input())
ans = "No"
j = 0
for i in range(n):
  d,dd = map(str,input().split())
  if(d==dd):
    if(j>0):
      j += 1
    else:
      j = 0
    if(j==3):
      ans = "Yes"
print(ans)
n = int(input())

affilé = 0

for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé == 0
  

  if affilé == 3:
    print('YES')
    exit()

print('NO')
# -*- coding: utf-8 -*-
# 入力
N = int(input())

l = []
for i in range(N):
    d1, d2 = map(int, input().split())
    l.append([d1, d2])

flag = 0
cont = 0
for i in l:
    if(i[0]==i[1]):
        flag = 1
        cont = cont + 1
        if (cont>=3):
            break
    else:
        cont = 0
        flag =0



if (cont >=3):
    print("yes")
else:
    print("no")
n=int(input())
c=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    c+=1
if c>3:
  print("Yes")
else:
  print("No")
N=int(input())
D={}
for i in range(N):
    D[i]=input().split()

cou=0
for i in range(N):
    if D[i][0]==D[i][1]:
        cou+=1
    else:
        cou=0
    
    if cou == 3:
        print('Yes')
        break

if cou == 0:
    print('No')
def dice(N):
    for i in range(len(N)-2):
        if N[i][0]==N[i][1] and N[i+1][0]==N[i+1][1] and N[i+2][0]==N[i+2][1]:
            return "Yes"
    return "No"

Number=int(input("N="))
N=[]
for i in range(Number):
    x,y=input().split()
    N.append([int(x), int(y)])
print(dice(N))
n = int(input())
def judge():
    count = 0
    flag = True
    for _ in range(n):
        d1, d2 = map(int, input().split(" "))
        if d1 == d2:
            count += 1
        else:
            count = 0
        
        
        if count == 3:
            return True

    return False

if judge() == True:
    print("yes")
else:
    print("no")
loop = int(input())
streak = 0
verify = False
for i in range(loop):
    diceArr = input().split()
    if streak==3:
        verify = True
    else:
        if diceArr[0] == diceArr[1]:
            streak+=1
        else:
            streak=0
if verify:
    print('Yes')
else:
    print('No')
N = int(input())
D = []
count = 0

for n in range(N):
    input_line = input().split()
    if (int(input_line[0]) == int(input_line[1]) & (count>0)):
        count += 1
    else:
        count = 0

if count >= 3:
        print('Yes')

else:
        print('No')
a2=int(input())
a=0
b3=0
for i in range(a2):
    b2,c2=map(str,input().split())
    b=int(b2)
    c=int(c2)
    if b==c:
        a+=1
    elif a==3:
        print('Yes')
        b3+=1
        break
    else:
        a=0
        
if b3>0:
    pass
else:
    print('No')
n = int(input())
arr= []
for i in range(n):
  z = [ int(i) for i in input().split()]
  arr.append(z)
  
count = 0 
for i in range(n):
  
    if arr[i][0] == arr[i][1]:
      count+=1
      
if count>=3:
  print("Yes")
else:
  print("No")
n = int(input())

num_list=[]

for i in range(n):
    a,b = map(str, input().split())
    num_list.append(a)
    num_list.append(b)
    s = ''.join(num_list)
if ('111' in s) or ('222' in s) or ('333' in s) or ('444' in s) or ('555' in s) or ('666' in s):
    print('YES')
else:
    print('NO')
import sys

def main():
    N = int(input())
    zoro = 0
    for i in range(N):
        Ds = [int(s) for s in sys.stdin.readline().split()]
        if(Ds[0] == Ds[1]):
            zoro += 1
            if(zoro > 2):
                print("Yes")
                return(0)
    print("No")

main()
x=int(input())
List=[]
counter=0
for i in range(x):
  List.append(list(map(int,input().split())))
for i in range(len(List)):
  if List[i][0]==List[i][1]:
    counter+=1
  else:
    counter=0
  if counter ==3:
    print("Yes")
if counter<3:
  print("No")
n = int(input())

affilé = 0
ok = 0


for i in range(n):
  d1, d2 = [int(k) for k in input().split()]
  if d1 == d2:
    affilé += 1
  elif d1 != d2:
    affilé = 0
  

  if affilé == 3:
    ok = 1

if ok == 0:
  print('NO')
else:
  print('YES')
N = int(input())

i = 0
res = False

for _ in range(N):  
    a, b = map(int,input().split())

    if a == b:
        print("matched")
        i += 1
    else:
        i = 0
        
    if i >= 3:
        res = True

print("Yes" if res else "No")
n = int(input())

count = 0
for i in range(n):
  a,b = list(map(int, input().split()))
  print(a,b)
n = int(input())
count = 0
ans = 'No'
for i in range(n):
    a, b = map(int, input().split())
    if count == 3:
        ans = 'Yes'
        break
    if a == b:
        count += 1
    else :
        count = 0
        pass

print(ans)
N = int(input())
i=0
cnt = 0
flg = 1

while i < N:
    i += 1
    a, b = map(int, input().split())
    if a==b:
        cnt += 1
    else:
        cnt = 0

if cnt >= 3:
    print("Yes")
else:
    print("No")
N = int(input())

count = 0

for i in range(N):
  D1, D2 = map(int, input().split())
  if D1 == D2:
    count += 1
  
if count >= 3:
    print('Yes')
else:
  print('No')
n = int(input())
d = [list(map(int, input().split())) for _ in range(n)]

c = 0
ans = False
for i in d:
    if d[0] == d[1]:
        c += 1
        if c >=3:
            ans = True
            break
    else:
        c = 0
if ans:
    print('Yes')
else:
    print("No")
i = int(input())
d = [list(map(int, input().split())) for i in range(i)]

c = 0
for i in range(len(d)):
    if (d[i][0] == d[i][1]):
        c += 1
print(c)
n = int(input())

pv = []
con = 0

while n > 0:
    n -= 1
    s = str(input())
    d = s.split()
    if d[0] == d[1]:
        con += 1
    else:
        if con >= 3:
            break
        pv += [con]
        con = 0

pv += [con]
ans = max(pv)

if ans >= 3:
    print('Yes')
else:
    print('NO')
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]

ans = 0
for i in range(n - 1):
    if x[i] == y[i]:
        ans += 1
        if ans == 3:
            print("Yes")
            break
    
    else:
        ans = 0
        

if ans == 0 or ans == 1 or ans == 2:
    print("No")
N = int(input())
D1 = []
for i in range(N):
    D = list(map(int, input().split()))
    D1.append(int(D[0]))
    D1.append(int(D[1]))

count = 0
for j in range(len(D1)-2):
    if D1[j] == D1[j+1] == D1[j+2]:
        count = count + 1
        break
if count == 1:
    print("Yes")
else:
    print("No")
n=int(input())
q=[]
for _ in range(n):
    d_1,d_2=map(int,input().split())
    if d_1==d_2:
        q.append(1)
    else:
        q.append(0)
for i in range(n-3):
    if q[i]==q[i+1]==q[i+2]==1:
        print("Yes")
        exit()
print("No")
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]
 
for i in range(N-2):
  if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]:
    print('Yes')
    break
    
print('No')
ans = 0
s = []
for i in range(int(input())):
  a,b = map(int,input().split())
  if a==b:
    ans += 1
    s.append(ans)
  else:
    ans = 0
if ans>=3:
  print('Yes')
else:
  print('No')
n=int(input())
count=0
for i in range(0,n):
  m,p=input().split() 
  if(m==p):
    count=count+1
if(count%3==0):
  print("Yes")
else:
    print("No")
N = int(input())
sub_yes = 0
max_yes = 0
for i in range(N):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        sub_yes += 1
    else:
        max_yes = sub_yes
        sub_yes = 0
if sub_yes > max_yes:
    max_yes = sub_yes
if max_yes >= 3:
    print("yes")
else:
    print("no")
n = int(input())

num_list=[]
count=0

for i in range(n):
    a,b = map(int, input().split())
    if a==b:
        count+=1
        if count>2:
            break
    if a!=b:
        count=0
if count>2:
    print('YES')
else:
    print('NO')
n=int(input())
m=0
for i in range(n):
  A,B=map(int,input().split())
  if (A==B):
    m=m+1
  else:
    m=0
  if (m==3):
    print("Yes")
    break
print("No")
num = int(input())
count = 0
for i in range(num):
    d1, d2 = map(int,input().split())
    count += 1 if d1 == d2 else 0
print("Yes" if count >= 3 else "No")
N = int(input())
count = 0
for i in range(N-1):
    a, b = list(map(int, input().split()))
    if a == b:
      count += 1
    else:
      count == 0
    if count == 3:
      print("Yes")
      break
print("No")
N = int(input())
count = 0
temp = 0

for _ in range(N):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        count += 1
    else:
        if temp < count:
            temp = count

if temp >= 3:
    print('Yes')
else:
    print('No')
ans = 0
for i in range(int(input())):
  a,b = map(int,input().split())
  if a==b:
    ans += 1
if ans>=3:
  print('Yes')
else:
  print('No')
cnt = int(input())

doublets = 0
while cnt > 0:
    if doublets == 3:
        print("YES")
        break
    x, y = tuple(map(int, input().split()))
    if x == y:
        doublets += 1
    else:
        doublets = 0
    cnt -= 1
else:
    print("NO")
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]


n = int(input())
row = False
cnt = 0
for _ in range(n):
    x,y = ip()
    if cnt == 3: row = True
    if x == y: cnt += 1
    else:
        cnt = 0

if row: print("Yes")
else: print("No")
n = int(input())
ds1 = []
ds2 = []
for _ in range(n):
    d1,d2 = list(map(int, input().split()))
    ds1.append(d1)
    ds2.append(d2)

matched = [d1 == d2 for d1,d2 in zip(ds1,ds2)]
cnt = 0
for m in matched:
    cnt = cnt+1 if m else 0
    if m == 3:
        break

if cnt == 3:
    print('Yes')
else:
    print('No')
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():
    q_num = input_int()

    count_num = 0

    for _ in range(q_num):

        a, b = input_int_map()

        if a == b:
            count_num += 1

            if count_num == 3:
                print('YES')
                return
        else:
            count_num = 0

    print('NO')

run()
t = int(input())

best = 0
cur = 0

for i in range(t):
  a,b = map(int,input().split())
  if a == b:
    cur += 1
  else:
    best = max(best,cur)
    cur = 0
print("Yes" if best >= 3 else "No")
n=int(input())
l=0
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        l+=1
    else:
        if l>=3:
            print("Yes")
            exit()
        l=0
print("Yes" if l>3 else "No")
n=int(input())
for i in range(0,n):
  count=0
  m,n=input().split() 
  if(m==0):
    count=count+1
if(count%3==0):
  print("Yes")
else:
    print("No")
N = int(input())
count = 0
list1 = []
list2 = []
for i in range(N-1):
    a, b = list(map(int, input().split()))
    list1.append(a)
    list2.append(b)
    
for i in range(N-1):
  if list1[i] == list2[i]:
    count += 1
    if count == 3:
      break
  else:
    count = 0
if count == 3:
  print("Yes")
else:  
  print("No")