#include #include using namespace std; long n,i,need,j; char s[1005]; int main() { cin>>s; n=strlen(s); i=0; while (i0) need--; else if (s[i]=='1' && need==0) { j=i+8-1; while (s[j]=='0') { j--; need++; } } /* else { cout<<"NO\n"; return 0; }*/ i+=8; } cout<<"YES"; return 0; }