n=gets.to_i;a=[*$<];puts~-a.map{|e|a.count e}.max>n/2?:NO:'YES'