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