using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ int howmany = int.Parse(Console.ReadLine()); string[] s = new string[howmany]; for (int i = 0; i < howmany; i++) { s[i] = Console.ReadLine(); } var answer = true; for (int i = 1; i < howmany; i++){ int x1 = int.Parse(s[i-1].Split(' ')[0]); int y1 = int.Parse(s[i-1].Split(' ')[1]); int x2 = int.Parse(s[i].Split(' ')[0]); int y2 = int.Parse(s[i].Split(' ')[1]); if ((x1 - x2) * (y1 - y2) != 0) { answer = false; break; } } Console.WriteLine(answer ? "YES" : "NO"); } }