using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { int n = int.Parse(Console.ReadLine()); var list = new List(); for(int i = 0; i < n; i++) list.Add(Console.ReadLine()); var max = list.GroupBy(y => y) .Max(z => z.Count()); if(max > ((n + 1) >> 1)) Console.WriteLine("NO"); else Console.WriteLine("YES"); } }