#include #include #include using namespace std; int main(){ string s; cin >> s; s += "0"; int bitcnt = 0; int blockcnt = 0; bool f = false; for(auto &it: s){ if(it == '1') bitcnt++; if(f != (it == '1')){ if(f) blockcnt++; f = !f; } } if(bitcnt == 0 || bitcnt == 2 || (blockcnt == 1 && bitcnt > 1)) cout << "Yes" << endl; else cout << "No" << endl; return 0; }