#include <bits/stdc++.h>

using namespace std;

char a[1001];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> a;
    if (a[0] == '0') {
        cout << "No\n";
        return 0;
    }
    int sz = strlen(a);
    int pos, cars = 0;
    for (int i = 0; i < sz; i += 8) {
        if (a[i] == '1') {
            if (cars) {
                cout << "No\n";
                return 0;
            }
            pos = i + 8 - 1;
            while (a[pos] == '0' && pos > i)
                ++cars, --pos;
        }
        else if (cars <= 0) {
            cout << "No\n";
            return 0;
        }
        else
            --cars;
    }
    cout << "Yes\n";
    return 0;
}