#include <cstdio>
#include <algorithm>
#include <vector>
#include <climits>
#include <cstring>

#define f first
#define s second

using namespace std;

char st[1024];

int main ()
{
   // freopen ("file.in", "r", stdin);

    gets (st + 1);

    int n = strlen (st + 1), nrcars = 0;
    for (int i = 1; i <= n; i += 8)
    {
        if ((st[i] == '1' && nrcars) || (st[i] == '0' && !nrcars))
        {
            printf ("No\n");
            return 0;
        }

        if (st[i] == '0')
        {
            --nrcars;
            continue;
        }

        int nr = 0;
        for (int j = i + 7; j >= i && st[j] == '0'; --j, ++nr);

        nrcars = nr;
    }

    if (nrcars)
    {
        printf ("No\n");
        return 0;
    }

    printf ("Yes\n");

    return 0;
}