y, m, d = gets.split.map &:to_i t = Time.new(y, m, d) if Time.new(1989, 1, 8) <= t && t <= Time.new(2019, 4, 30) puts :Yes else puts :No end