#include using namespace std; int main() { int y, m, d, ans = 0; cin >> y >> m >> d; if ((1989 < y) && (y < 2019)) {ans = 1;} else if ((y == 1989) && (1 < m)) {ans = 1;} else if ((y == 1989) && (m == 1) && (d >= 8)) {ans = 1;} else if ((y == 2019) && (m < 5)) {ans = 1;} if (ans == 1) {cout << "Yes";} else {cout << "No";} }