Y,M,D = gets.split(" ").map!{|i| i.to_i} if Y > 1990 && Y < 2019 then puts "Yes" elsif (Y == 1989 && M > 1 ) then puts "Yes" elsif (Y == 1989 && M == 1 && D >= 8) then puts "Yes" elsif (Y == 2019 && M < 4) then puts "Yes" elsif (Y == 2019 && M == 4 && D <= 30) then puts "Yes" else puts "No" end