N=int(input()) l=[] for i in range(N): u,w=map(int,input().split()) l.append(w) l.sort() if l[0]!=1: print("No") else: print("Yes")