require 'date' startDate = Date.new(1989, 1, 8) endDate = Date.new(2019, 4, 30) y, m, d = gets.chomp.split(' ').map(&:to_i) date = Date.new(y, m, d) if (startDate..endDate).cover?(date) then puts "Yes" else puts "No" end