#include int main(void){ int y, m, d; scanf("%d%d%d", &y, &m, &d); if((y < 1989 || 2019 < y) || ((y == 1989 && m == 1) && (d < 8)) || ((y == 2019) && (m > 4))) printf("NO"); else printf("YES"); return 0; }