n=gets.to_i puts $<.group_by{|s|s}.map{|k,v|v.size}.max>n-n/2?:NO: :YES