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