using System; using System.Linq; using System.Collections.Generic; class No349 { static void Main() { var num = Int32.Parse(Console.ReadLine()); var dic = new Dictionary(); for (int i = 0; i < num; ++i) { var key = Console.ReadLine(); if (dic.ContainsKey(key)) dic[key]++; else dic.Add(key, 1); } var max = dic.Values.Max(); var count = num % 2 == 0 ? num / 2 : num / 2 + 1; Console.WriteLine(max <= count?"YES":"NO"); } }