import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n= int(input())
d = [0] * n
for i in range(n):
    d[i] = tuple(map(int, input().split()))

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')
        sys.exit(0)
print('No')
