using System; using System.Collections.Generic; namespace _349 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); Dictionary dic = new Dictionary(); for (int i = 0; i < n; i++) { string s = Console.ReadLine(); if (!dic.ContainsKey(s)) dic[s] = 0; dic[s]++; } int max = 0; foreach (var item in dic) max = Math.Max(max,item.Value); Console.WriteLine(max <= (n + 1) / 2 ? "YES" : "NO"); } } }