#include int main(void) { int y,m,d; scanf("%d%d%d",&y,&m,&d); if(y>=1989 && y<=2019){ switch (y){ case 1989: if (m == 1){ if (d < 8){ printf("No\n"); } else { printf("Yes\n"); } } else { printf("Yes\n"); } break; case 2019: if (m <= 4){ printf("Yes\n"); } else { printf("No\n"); } break; default : printf("Yes\n"); break; } } else { printf("No\n"); } return 0; }