n=int(input())
for _ in range(n):
    v,w=map(int,input().split())
    if w == 1:
        print('Yes')
        exit()
print('No')