#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; string solve(int Y, int M, int D){ if(1990 <= Y && Y <= 2018) return "Yes"; if(Y == 1989){ if(M >= 2) return "Yes"; else { if(D >= 8) return "Yes"; } } if(Y == 2019){ if(M <= 3) return "Yes"; else if(M == 4){ if(D <= 30) return "Yes"; } } return "No"; } int main(){ int Y, M, D; cin >> Y >> M >> D; cout << solve(Y, M, D) << endl; return 0; }