gets.chomp.split("").each_with_index do |char,index| if index.even? && char.upcase == char || index.odd? && char != " " puts "No" exit end end puts "Yes"