n=gets.to_i puts readlines.group_by{|x|x}.map{|k,v|v.size}.max>n/2 ? :NO : :YES