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()); bool v=true, h=true; int x0=0, y0=0; 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]); if(a0==0){x0=x; y0=y;} else { v&=x0==x; h&=y0==y; } } if(v | h) Console.WriteLine("YES"); else Console.WriteLine("NO"); } }