#!/bin/python import sys n = int(raw_input().strip()) arr = [] for a0 in xrange(n): x,y = raw_input().strip().split(' ') arr.append([int(x),int(y)]) xx = None yy = None x_yes = True y_yes = True for point in arr: if not xx: xx = point[0] if not yy: yy = point[1] if not point[0] == xx: x_yes = False if not point[1] == yy: y_yes = False if x_yes or y_yes: print "YES" else: print "NO"