using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { /* var n = */ Convert.ToInt32(Console.ReadLine()); var point1 = Console.ReadLine().Split(); int x1 = Convert.ToInt32(point1[0]), y1 = Convert.ToInt32(point1[1]); string line; var noX = false; var noY = false; while ((line = Console.ReadLine()) != null) { var pointI = line.Split(); if (x1 != Convert.ToInt32(pointI[0])) { noX = true; } if (y1 != Convert.ToInt32(pointI[1])) { noY = true; } if (noX && noY) { break; } } Console.WriteLine(noX && noY ? "NO" : "YES"); } }