N=gets.to_i a=Hash.new(0) $<.read.split(/\n/).map{|l|a[l]+=1} m=a.max_by(&:last)[1] puts m <= (N/2.0).ceil ? "YES" : "NO"