#include using namespace std; #define ll long long #define ld long double #define pb push_back #define mp make_pair #define pii pair #define pll pair #define pdd pair #define all(x) (x).begin(), (x).end() #define fi first #define se second char s[10005]; int sol[10005]; int main() { cin.sync_with_stdio(false); cin >> (s + 1); int n = strlen(s + 1); int cnt = 0; for (int i = 1; i <= n; i += 8) { cnt++; if (s[i] == '0') sol[cnt] = -1; else { int mlc = 0; for (int j = i + 7; j >= i + 1; j--) { if (s[j] == '0') mlc++; else break; } sol[cnt] = mlc; } } bool ok = 1; for (int i = 1; i <= cnt;) { if (sol[i] == -1) { ok = 0; break; } for (int j = i + 1, k = 1; k <= sol[i]; j++, k++) if (j > cnt || sol[j] != -1) { ok = 0; break; } i += sol[i] + 1; } if (ok) cout << "Yes"; else cout << "No"; return 0; }