#include using namespace std; const int NMax = 1e5 + 5; int main(){ #ifndef ONLINE_JUDGE freopen("debug.in", "r", stdin); #endif // ONLINE_JUDGE int cars = 0; string S; cin >> S; for(int i = 0 ; i < (int)S.size(); i += 8){ if(S[i] == '0'){ cars = max(0, cars - 1); } else { if(cars != 0){ cout << "No"; return 0; } for(int j = i + 7; j >= i + 1 && S[j] == '0'; j--){ cars++; } } } if(cars == 0){ cout << "Yes"; } else { cout << "No"; } return 0; }