#!/bin/python import sys n = int(raw_input().strip()) points = [] for a0 in xrange(n): x,y = raw_input().strip().split(' ') x,y = [int(x),int(y)] points.append([x, y]) slope = 0 invert = False b = 0 if (points[1][0] - points[0][0]) == 0: invert = True if not invert: b = points[1][1] else: b = points[1][0] allIn = True for i in xrange(n): if not invert and points[i][1] != b: allIn = False elif invert and points[i][0] != b: allIn = False if allIn: print "YES" else: print "NO"