import sys readline=sys.stdin.readline write=sys.stdout.write N=int(readline()) V,W=[],[] for _ in range(N): v,w=map(int,readline().split()) V.append(v) W.append(w) if 1 in W: ans="Yes" else: ans="No" print(ans)