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