let D = readLine()!.split(separator: " ").map{Int($0)!} let d = D[0] * 10000 + D[1] * 100 + D[2] print(19890108 <= d && d <= 20190430 ? "Yes" : "No")