S = gets.chomp.chars odds = [] evens = [] S.each.with_index(1) do |s, i| if i.even? evens << s else odds << s end end if evens.all?(/\s/) && odds.all?(/\w/) puts 'Yes' else puts 'No' end