#include using namespace std; int main() { int Y, M, D; cin >> Y >> M >> D; string ans = "No"; if( 1989 < Y && Y < 2019 ) ans = "Yes"; else { if( Y == 1989 && M > 1 ) ans = "Yes"; else if( Y == 1989 && M == 1 && D >= 8 ) ans = "Yes"; else if( Y == 2019 && M < 4 ) ans = "Yes"; else if( Y == 2019 && M == 4 && D <= 30 ) ans = "Yes"; } cout << ans << endl; }