# Enter your code here. Read input from STDIN. Print output to STDOUT point_count = int(raw_input()) game = [] for p in xrange(point_count): game.append([int(x) for x in raw_input().strip().split()]) is_x = True is_y = True x_val = game[0][0] y_val = game[0][1] for p in xrange(1, point_count): this_point = game[p] if is_x and this_point[0] == x_val: is_x = True else: is_x = False if is_y and this_point[1] == y_val: is_y = True else: is_y = False if is_x or is_y: print "YES" else: print "NO"