#!/bin/python3 import sys is_vertical = True is_horizontal = True x_0 = 0 y_0 = 0 n = int(input().strip()) for a0 in range(n): x,y = input().strip().split(' ') x,y = [int(x),int(y)] if (a0 == 0): x_0 = x y_0 = y if x != x_0: is_horizontal = False if y != y_0: is_vertical = False if is_vertical or is_horizontal: print("YES") else: print("NO")