import math N=int(input()) for i in range(N): v,w=map(int,input().split()) if w==1: print("Yes");exit() print("No")