#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { string s; cin >> s; int n = s.size(); int now = 0; for (int i = n - 1; i > 0; i--) { if (s[i] >= '2' && s[i] <= '4') { s[i - 1]--; } else { now = i; continue; } } bool b = true; for (int i = 0; i <= now; i++) { if (s[i] == '6' || s[i] == '7') { } else { b = false; } } if (b || s[0] == '0') { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }