#include using namespace std; static const int INF = 1e9 + 7; template using Vec = vector; template using P = pair; template using Tup = tuple; template using qp = priority_queue, greater >; template using pq = priority_queue; using llong = long long; using ullong = unsigned long long; using uint = unsigned int; template T gcd(T x, T y) { return y ? gcd(y, x % y) : x; } void hawawa() { int y, m, d; cin >> y >> m >> d; if (y < 1989 || 2019 < y) { cout << "No\n"; } else if (y == 1989) { if (1 < m) { cout << "Yes\n"; } else if (7 < d) { cout << "Yes\n"; } else { cout << "No\n"; } } else if (y == 2019) { if (m < 5) { cout << "Yes\n"; } else { cout << "No\n"; } } else { cout << "Yes\n"; } } int main() { ios::sync_with_stdio(false); cin.tie(0); hawawa(); }