#include #include #include #include using namespace std; template int maxReturn(T a, T b) {if (a > b) {return a;} else {return b;}} template int minReturn(T a, T b) {if (a < b) {return a;} else {return b;}} const int heiseiYearStart = 1989; const int heiseiMonthStart = 1; const int heiseiDayStart = 8; const int heiseiYearEnd = 2019; const int heiseiMontEnd = 4; const int heiseiDayEnd = 30; bool isHeisei(int Y, int M, int D) { if (Y >= heiseiYearStart && Y <= heiseiYearEnd) { if (Y == heiseiYearStart) { if (M == heiseiMonthStart && D >= heiseiDayStart) return true; if (M != heiseiMonthStart && M >= heiseiMonthStart) return true; } else if (Y == heiseiYearEnd) { if (M == heiseiMontEnd && D <= heiseiDayEnd) return true; if (M != heiseiMontEnd && M <= heiseiMontEnd) return true; } else { return true; } } return false; } int main(void){ int Y,M,D; string ans = "No"; cin >> Y >> M >> D; if (isHeisei(Y, M, D)) ans = "Yes"; cout << ans << endl; }