#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ll long long
#define pii pair<int,int>
#define tii tuple <int,int,int>
#define N 200005
#define mod 1000000005
#define X first
#define Y second
#define eps 0.0000000001
#define all(x) x.begin(),x.end()
#define tot(x) x+1,x+n+1
using namespace std;

string s;
int i, j, cnt, n;

int main() {
    cin.sync_with_stdio(0);
    cout.sync_with_stdio(0);
    cin >> s;
    n = s.size();

    for(i = 0; i < n; i += 8) {
        if(cnt) {
            if(s[i] != '0') {
                cout << "No";
                return 0;
            }

            cnt--;
            continue;
        }

        if(s[i] == '0') {
            cout << "No";
            return 0;
        }

        cnt = 0;

        for(j = 7 + i;; j--) {
            if(s[j] == '0')
                cnt++;
            else
                break;
        }
    }

    if(cnt) {
        cout << "No";
        return 0;
    }

    cout << "Yes";
    return 0;
}