#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long int ll const MOD = 1000000007; ll const INF = (long long int)1 << 61; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll y,m,d; cin >> y >> m >> d; if(y > 1989 && y < 2019){ cout << "Yes" << endl; }else if(y < 1989 || y > 2019){ cout << "No" << endl; }else if(y == 1989){ if(m > 1){ cout << "Yes" << endl; }else{ if(d >= 8){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } }else{ if(m < 4){ cout << "Yes" << endl; }else if(m == 4){ if(d <= 30){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }else{ cout << "No" << endl; } } return 0; }