#!/bin/python import sys n = int(raw_input().strip()) x_set = set() y_set = set() for a0 in xrange(n): x,y = raw_input().strip().split(' ') x,y = [int(x),int(y)] x_set.add(x) y_set.add(y) if len(x_set) > 1: if len(y_set) > 1: print "NO" else: print "YES" else: print "YES"