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