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()); string[] tokens_x = Console.ReadLine().Split(' '); int x = Convert.ToInt32(tokens_x[0]); int y = Convert.ToInt32(tokens_x[1]); int x0 = x; int y0 = y; bool xLine = true; bool yLine = true; for (int a0 = 0; a0 < n -1; a0++) { tokens_x = Console.ReadLine().Split(' '); x = Convert.ToInt32(tokens_x[0]); y = Convert.ToInt32(tokens_x[1]); if (x0 != x) { xLine = false; } if (y0 != y) { yLine = false; } } string ans = xLine || yLine ? "YES" : "NO"; Console.WriteLine(ans); } }