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[] xx = new int[n]; int[] yy = new int[n]; for(int a0 = 0; a0 < n; a0++){ string[] tokens_x = Console.ReadLine().Split(' '); xx[a0] = Convert.ToInt32(tokens_x[0]); yy[a0] = Convert.ToInt32(tokens_x[1]); } bool xxx = true; bool yyy = true; for (int i = 1; i < n; i++) { if (xx[i] != xx[0]) xxx = false; if (yy[i] != yy[0]) yyy = false; } Console.WriteLine(xxx || yyy ? "YES" : "NO"); } }