MODE = "stdio" tmp = Array.new if(defined? MODE) tmp = STDIN.read.split("\n") else iotmp = "\ 4 hitsuji ne hitsuji hitsuji ".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} a = okimono.shift[1] b = (N/2.0).ceil if a<=b puts "YES" else puts "NO" end