#include #include #include #include #include #include #define ll long long #define P pair #define lP pait using namespace std; int main() { int l,m,n; bool f=0; cin>>l>>m>>n; if(l==1989){ if (m==1 and n>=8) f=1; else f=1; } else if(l>1989 and l<2019) f=1; else if (l==2019){ if(m<4) f=1; else if(m==4 and n<=30) f=1; } if(f) cout<<"Yes"<