import sys input = lambda: sys.stdin.readline().rstrip() # ----------------------- # n = int(input()) uv = [list(map(int, input().split())) for _ in range(n)] one = False for u,v in uv: if v == 1: one = True print('Yes' if one else 'No')