ymd = gets.chomp.split.map(&:to_i) case ymd in [1989, 1, ..7] puts 'No' in [2019, 5.., *] puts 'No' in [1989..2019, *] puts 'Yes' else puts 'No' end