#include using namespace std; using uint = unsigned int; using lint = long long int; using ulint = unsigned long long int; template using V = vector; template using VV = V< V >; template void assign(V& v, int n, const U& a) { v.assign(n, a); } template void assign(V& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int y, m, d; cin >> y >> m >> d; int x = 10000 * y + 100 * m + d; cout << (19890108 <= x and x <= 20190430 ? "Yes" : "No") << '\n'; }