N = gets.to_i S = N.times.map{gets.chomp}.group_by(&:itself).values.map(&:size).max puts S > (N + 1) / 2 ? :NO : :YES