#include using namespace std; int main(void){ // Your code here! string s; cin >> s; int cnt = 0; int cnt2 = 1; bool is1 = s[0] == '1'; bool all1 = true; for(char c : s){ if(c == '1'){ cnt++; } if(is1 != (c == '1')){ is1 = !is1; cnt2++; } if(c != '1'){ all1 = false; } } cout << (cnt == 2 || (cnt > 2 && all1) || min(cnt,cnt2) == 2 ? "Yes" : "No") << endl; }