#include #include #include #include #include #include #include #include #include #include using namespace std; #define int long long int MOD = 1000000007; signed main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; //vector A(N); int res = 0; int c = 0; bool ok = true; bool f = true; for (int i = (int)S.size() - 1; i >= 0; i--) { int a = S[i] - '0'; a -= c; c = 0; if (a < 0) { a += 10; c++; } if (a == 2 || a == 3 || a == 4) { c++; if (!f) { ok = false; break; } }else if (a == 7 || a == 6) { if (i == (int)S.size() - 1) { ok = false; break; } f = false; } else { if (i == 0 && a == 0) { } else { ok = false; break; } } } if (c != 0) { ok = false; } if (ok) { cout << "Yes" << endl; } else { cout << "No" << endl; } }