#include #include #include #include #include #include #include #include #include #include #include #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define llong long long #define pb(a) push_back(a) using namespace std; typedef pair P; typedef long long int ll; typedef pair LLP; int dx[4] = {1,0,0,-1}; int dy[4] = {0,1,-1,0}; //#define INF 1000000007 #define MOD 1000000007 #define MAX_N 105 #define MAX_V 1005 const ll INF = LLONG_MAX/2; int main(){ int y,m,d; cin >> y >> m >> d; bool ans = true; if(y == 1989){ if(m == 1){ if(d >= 8){ ans = true; }else{ ans = false; } }else{ ans = true; } }else if(y == 2019){ if(m == 4){ if(d <= 30){ ans = true; }else{ ans = false; } }else if(m < 3){ ans = true; }else{ ans = false; } }else if(y > 1989 && y < 2019){ ans = true; }else{ ans = false; } if(ans){ cout << "Yes" << endl; }else{ cout << "No" << endl; } return 0; }