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 isFirst = true; int allX = 0; int allY = 0; bool allXSame = true; bool allYSame = true; 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(isFirst){ allX = x; allY = y; isFirst = false; } else{ if(x!=allX) allXSame = false; if(y!=allY) allYSame = false; } } if(allXSame || allYSame) Console.WriteLine("YES"); else Console.WriteLine("NO"); } }