using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); int[] points = new int[2 * n]; for(int a0 = 0; a0 < n; a0++){ string[] tokens_x = Console.ReadLine().Split(' '); int x = Convert.ToInt32(tokens_x[0]); int y = Convert.ToInt32(tokens_x[1]); points[a0] = x; points[a0 + points.Length / 2] = y; } int vert_point = points[0]; int hori_point = points[points.Length / 2]; bool vert = true; bool hori = true; for(int i = 1; i < n; i++){ if(vert){ if(points[i] != vert_point){ vert = false; } } } for(int i = points.Length / 2 + 1; i < 2 * n; i++){ if(hori){ if(points[i] != hori_point){ hori = false; } } } Console.WriteLine((vert || hori) ? "YES" : "NO"); } }