#include using namespace std; const long long INF = 1LL << 60; #define MOD 1000000007; typedef long long ll; #define writeln(n) cout< P; typedef pair Psi; int main() { int y,m,d; cin>>y>>m>>d; if(1989 <=y && 1 <=m ){ if(2 <=m){ writeln("Yes"); return 0; } if(m ==1 && 8<=d){ writeln("Yes"); }else { writeln("No"); } }else { writeln("No"); } }