#!/bin/python3 import sys xPoints = set() yPoints = set() n = int(input().strip()) for a0 in range(n): x,y = input().strip().split(' ') x,y = [int(x),int(y)] xPoints.add(x) yPoints.add(y) if(len(xPoints) == 1 or len(yPoints) == 1): print("YES") else: print("NO")