#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 and m>=1 and n>=8) f=1; else if(l>1989 and l<2019) f=1; else if (l==2019 and m<=4 and n<=30) f=1; if(f) cout<<"Yes"<