# 入力された値を文字列で受け取る input = gets.chomp str = input.chars if str[0] == str[1] if str[0] != str[2] puts "Yes" exit end end puts "No"