using System; using System.Collections.Generic; using System.Linq; namespace yukicodeX { public class ProgramX { public static string Solver(System.IO.TextReader reader) { var n = int.Parse( reader.ReadLine() ); var x = 0; var figures = new Dictionary(); for (var i = 0; i != n; ++i) { var buf = reader.ReadLine().Split(); if (figures.ContainsKey( buf[ 0 ] )) figures[ buf[ 0 ] ] += 1; else figures.Add( buf[ 0 ], 1 ); if (figures[ buf[ 0 ] ] > x) ++x; } return n % 2 == 0 ? x > n / 2 ? "NO" : "YES" : x > n / 2 + 1 ? "NO" : "YES"; } private static void Main() { Console.WriteLine( Solver( Console.In ) ); } } }