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