#!/bin/python import sys n = input() xp = 0 yp = 0 xs = 0 ys = 0 ctr = 0 for a0 in xrange(n): x,y = raw_input().strip().split(' ') x,y = [int(x),int(y)] if a0 == 0: xp = x yp = y if not(xp == x): xs = 1 if not(yp == y): ys = 1 if ys and xs: print 'NO' else: print 'YES'