N=int(input())
VW=[list(map(int,input().split())) for _ in range(N)]
VW.sort(key=lambda x:x[1])

print("Yes" if VW[0][1]==1 else "No")