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