using System; using System.Collections; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); Dictionary etoList = new Dictionary(); string eto = ""; for (int i = 0; i < N; i++) { eto = Console.ReadLine(); if (!etoList.ContainsKey(eto)) { etoList.Add(eto, 0); } etoList[eto] = int.Parse(etoList[eto].ToString()) + 1; } Console.WriteLine(etoList.OrderBy(x => x.Value).Last().Value <= (double)N / 2 ? "YES" : "NO"); } }