require 'date' H = (Date.new(1989,1,8) .. Date.new(2019,4,30)) t = Date.new(*gets.split.map(&:to_i)) puts H.include?(t) ? 'Yes' : 'No'