#include #include using namespace std; char s[10000]; int main() { cin >> s; int l = strlen( s ); int n = l / 8; int i = 0; while( i < n ) { if( s[i] == '0' ) { cout << "No"; return 0; } int nr1 = 0; int j = i + 7; while( s[j] == '0' ) { nr1 ++; j --; } for( int k = 1; k <= nr1; k ++ ) { i = i + 8; if( s[i] != '0' ) { cout << "No"; return 0; } } i = i + 8; } cout << "Yes"; }