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