strs = gets.chomp ok = false strs.chars.each_cons(9) do |s| ok ||= s.uniq.size == s.size end puts ok ? 'Yes' : 'No'