#include <bits/stdc++.h> using namespace std; int main() { string S; cin>>S; int N=S.size(),iti=0,L=1e9,R=-1e9; for(int i=0;i<N;i++)if(S[i]=='1'){ L=min(L,i); R=max(R,i); iti++; } bool OK=0; if(iti<=2||R-L+1==iti)OK=1; if(iti<=1)OK=0; cout<<(OK?"Yes":"No")<<endl; }