using System; using System.Collections.Generic; using System.Linq; class Program { public void Solve() { 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 <= Math.Ceiling((double)N / 2) ? "YES" : "NO"); } static void Main() { var solver = new Program(); solver.Solve(); } }