year, month, day = gets.split target = Time.new(year, month, day) if target >= Time.new(1989, 1, 8) && target <= Time.new(2019, 4, 30) puts 'Yes' else puts 'No' end