using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] argv){ int N = Convert.ToInt32(Console.ReadLine()); int[] mempointx = new int[22]; int[] mempointy = new int[22]; for (int i = 0; i < N; i++) { string[] point = Console.ReadLine ().Split (' '); mempointx[Convert.ToInt32(point[0])+10]++; mempointy[Convert.ToInt32(point[1])+10]++; } bool found = false; for (int i = 0; i <= 20; i++) if (mempointx[i] == N) { Console.WriteLine("YES"); found = true; break; } if(!found) for (int i = 0; i <= 20; i++) if (mempointy[i] == N) { Console.WriteLine("YES"); found = true; break; } if(!found) Console.WriteLine("NO"); } }