# `年 月 日` の情報を受け取る input = gets(chomp: true) # スペース区切りで配列に変換する strs = input.split # `年` `月` `日` でそれぞれ数値に変換して変数に代入する year = strs[0].to_i month = strs[1].to_i day = strs[2].to_i a = Date.new(year, month, day) b = Date.new(1989, 1, 8) c = Date.new(2019, 4, 30) if a >= b && a <= c puts "Yes" else puts "No" end