Y,M,D=gets.chomp.split(/\s+/).map(&:to_i) d="#{Y}#{format('%02d',M)}#{format('%02d',D)}".to_i puts 19890108<=d && d<=20190430 ? "Yes" : "No"