using System.Collections.Generic; using System; public class Hello { public static void Main() { var d = new Dictionary(); var n = int.Parse(Console.ReadLine().Trim()); var dmax = 0; for (int i = 0; i < n; i++) { var s = Console.ReadLine().Trim(); if (d.ContainsKey(s)) d[s]++; else d[s] = 1; dmax = Math.Max(dmax, d[s]); } string ans; if ((n % 2 == 0 && dmax <= n / 2) | (n % 2 == 1 && dmax <= (n + 1) / 2)) ans = "YES"; else ans = "NO"; Console.WriteLine(ans); } }