import scala.io.StdIn.readLine object yuki0779 { def main(args: Array[String]): Unit = { val ymd = readLine().split(" ").map(_.toInt) (ymd(0),ymd(1), ymd(2)) match { case (y,m,d) if y == 1989 && ((m >= 1 && d >= 8) || 2 <= m) => println("Yes") case (y,m,d) if y == 2019 && ((m <= 4 && d <= 30) || m <= 3) => println("Yes") case (y,_,_) if 1990 <= y && y <= 2018 => println("Yes") case (_,_,_) => println("No") } } }