x, y = set(), set() for _ in xrange(input()): a,b=map(int, raw_input().split()) x.add(a),y.add(b) if len(x)==1 or len(y)==1: print 'YES' else: print 'NO'