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 isCorrect = true; string[] tokens_x1 = Console.ReadLine().Split(' '); int x1 = Convert.ToInt32(tokens_x1[0]); int y1 = Convert.ToInt32(tokens_x1[1]); string[] tokens_x12 = Console.ReadLine().Split(' '); int x12 = Convert.ToInt32(tokens_x12[0]); int y12 = Convert.ToInt32(tokens_x12[1]); if(x1==x12){ for(int a0 = 0; a0 < n-2; a0++){ if(!isCorrect) {Console.ReadLine();continue;} else{ string[] tokens_x = Console.ReadLine().Split(' '); int x = Convert.ToInt32(tokens_x[0]);// int y = Convert.ToInt32(tokens_x[1]); if(x!=x1){ isCorrect=false; } } } } else if(y1==y2){ // else if(y!=y1){ // isCorrect=false; for(int a0 = 0; a0 < n-2; a0++){ if(!isCorrect){ Console.ReadLine(); continue;} else{ string[] tokens_x = Console.ReadLine().Split(' '); int y = Convert.ToInt32(tokens_x[1]);// int y = Convert.ToInt32(tokens_x[1]); if(y!=y1){ isCorrect=false; } } } } } else{ isCorrect=false; for(int a0 = 0; a0 < n-2; a0++){ Console.ReadLine(); } } if(isCorrect){ Console.WriteLine("YES"); } else{ Console.WriteLine("NO"); } } }