#!/bin/python import sys n = int(raw_input().strip()) same_x = True same_y = True (last_x, last_y) = (None, None) for a0 in xrange(n): x,y = raw_input().strip().split(' ') x,y = [int(x),int(y)] if last_x != None and last_x != x: same_x = False if last_y != None and last_y != y: same_y = False last_x, last_y = (x, y) if same_x or same_y: print "YES" else: print "NO"