#include <bits/stdc++.h>

using namespace std;

char str[1000000];

int main() {

//    freopen("debug", "r", stdin);
    cin >> str;

    for(int i = 0; str[i]; i += 8) {
        if(str[i] == '1') {
            int nobits = 0;

            for(int j = i + 7; str[j] == '0'; j--)
                nobits += 1;

            for(int j = 1; j <= nobits; j += 1)
                if(str[i + j * 8] != '0') {
                    cout << "No\n";
                    return 0;
                }

            if(str[i + (nobits + 1) * 8] == '0') {
                cout << "No\n";
                return 0;
            }
        }
    }

    cout << "Yes\n";

    return 0;
}