#!/bin/python3 import sys currentX = -100 currentY = -100 isGood = "YES" n = int(input().strip()) for a0 in range(n): x,y = input().strip().split(' ') x,y = [int(x),int(y)] if currentX == -100 or currentY == -100: currentX = x currentY = y elif (x > currentX or x < currentX) and (y > currentY or y < currentY): isGood = "NO" print(isGood)