S = [1989, 1, 7] R = [2019, 5, 1] H = gets.split.map &:to_i puts (S <=> H) < 0 && (H <=> R) < 0 ? "Yes" : "No"