#!/bin/python3 import sys def same_line(lst): xval = lst[0][0] yval = lst[0][1] xboo = True yboo = True for pt in lst: xboo = xboo and pt[0] == xval yboo = yboo and pt[1] == yval return xboo or yboo lst = [] n = int(input().strip()) for a0 in range(n): x,y = input().strip().split(' ') x,y = [int(x),int(y)] lst.append((x, y)) if same_line(lst): print("YES") else: print("NO")