#include int main() { int Y; int M; int D; while (true) { std::cin >> Y; if (Y >= 1969 && Y <= 2038)break; } while (true) { std::cin >> M; if (M >= 1 && M <= 12) { if (Y == 1969 && M == 12)break; else if (Y == 2038 && M <= 4)break; else if (Y >= 1970 && Y <= 2037)break; } } while (true) { std::cin >> D; switch (M) { case 1: if (D >= 1 && D <= 31)break; break; case 2: if (D >= 1 && D <= 27)break; break; case 3: if (D >= 1 && D <= 31)break; break; case 4: if (D >= 1 && D <= 30)break; break; case 5: if (D >= 1 && D <= 31)break; break; case 6: if (D >= 1 && D <= 30)break; break; case 7: if (D >= 1 && D <= 31)break; break; case 8: if (D >= 1 && D <= 31)break; break; case 9: if (D >= 1 && D <= 30)break; break; case 10: if (D >= 1 && D <= 31)break; break; case 11: if (D >= 1 && D <= 30)break; break; case 12: if (D >= 1 && D <= 31)break; break; } } bool hantei; if (Y >= 1989 && Y <= 2019) { if (Y == 1989 && M == 1 && M >= 8)hantei = true; if (Y == 2019 && M <= 4)hantei = true; if (Y >= 1990 && Y <= 2018)hantei = true; else hantei = false; } if (hantei == true)std::cout << "Yes" << std::endl; if (hantei == false)std::cout << "No" << std::endl; return 0; }