main = getLine >>= putStrLn . f . map (read :: String -> Int) . words where f [y,m,d] | y == 1989 && m == 1 = if d > 7 then "Yes" else "No" | y >= 1989 && y < 2019 = "Yes" | y == 2019 && m <= 4 = "Yes" | otherwise = "No"