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