MODE = "stdio" tmp = Array.new if(defined? MODE) tmp = STDIN.read.split("\n") else iotmp = "\ 19 ne ushi tora u tatsu mi uma hitsuji saru tori inu inu inu i ".split("\n") iotmp.each{|s| tmp << s.strip } end N = tmp[0].to_i okimono = Hash.new(0) (1..N).each do |n| okimono[tmp[n]]+=1 end okimono = okimono.sort_by{|k,v| -v} if okimono.shift[1] <= (N/2).ceil puts "YES" else puts "NO" end