using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using static System.Math; namespace SortItems { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var d = new Dictionary(); for (var i = 0; i < n; i++) { var s = Console.ReadLine(); if (d.ContainsKey(s)) { d[s]++; } else { d[s] = 1; } } if (d.Values.Max() < (n+1)/2+ 1) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }