#include #include #include #include #include using namespace std; int n; char s[1000]; int main() { // freopen("tr.in", "r", stdin); // freopen("tr.out", "w", stdout); fgets(s, 1000, stdin); int i = 0, l = strlen(s), ok = 1; while (i < l){ if (ok == 0) break; if (s[i] == '0'){ ok = 0; break; } int trailings = 0; int j = i+7; while (s[j] == '0'){ j--; trailings++; } while (trailings){ i+=8; if (s[i] == '1'){ ok = 0; break; } trailings--; } i+=8; } if (ok == 1) printf("Yes"); else printf("No"); return 0; }