/*
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256

using namespace std;

const int N = 120000;

string st;
int shit;

int have_loc;
int rem;

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin >> st;

	for (int i = 0; i < st.size(); i += 8)
	{
		int tp = 0;
		if (st[i] == '1')
			tp = 1;
		else
			tp = 0;
		if (tp == 1 &&rem != 0)
			shit = 1;
		if (tp == 0)
		{
			--rem;
			continue;
		}
		have_loc = 1;
		rem = 0;
		int ps = i + 7;
		while (st[ps] == '0')
		{
			++rem;
			--ps;
		}
	}

	if (rem != 0)
		shit = 1;

	if (shit)
		cout << "No" << endl;
	else
		cout << "Yes" << endl;

	cin.get(); cin.get();
	return 0;
}