#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using uint = unsigned; using vi = vector; using vl = vector; using vll = vector; using vd = vector; using vvi = vector; using vvl = vector; using vvll = vector; using vc = vector; using vs = vector; using vb = vector; using pii = pair; using pcc = pair; using pll = pair; using pdd = pair; using vpii = vector; using vpll = vector; typedef complex xy_t; templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define repback(i, n) for (ll i = n-1; i >= 0; i--) #define REP(i, a, b) for (ll i = a; i < ll(b); i++) #define REPBACK(i, a, b) for (ll i = a-1; i >= ll(b); i--) #define all(x) (x).begin(), (x).end() #define EPS (1e-10) #define equals(a,b) (fabs((a) - (b)) < EPS) #define debug(x) cout << "debug:" << x << endl #define debug2(x, y) cout << "debug:" << x << " " << y << endl static const double pi = acos(-1.0); const long long INFL = pow(10,18); const long long INFLMAX = 9223372036854775807; const int INF = pow(10,9); const int INFMAX = 2147483647; const int mod1 = 1000000007; const int mod2 = 998244353; const vi dx = {1,0,-1,0}; const vi dy = {0,1,0,-1}; const vi dx2 = {0, 1, 1, 1, 0, -1, -1, -1, 0}; const vi dy2 = {1, 1, 0, -1, -1, -1, 0, 1, 1}; int main(){ cin.tie(0); ios_base::sync_with_stdio(false); string N; cin >> N; ll cntone = 0; ll cntlen = 0; rep(i,N.size()){ if(N[i] == '1'){ cntone++; } if(cntlen == 0 && cntone > 0 && N[i] == '0') cntlen = cntone; } if(cntone == 2 || (cntlen == cntone && cntone > 1)) cout << "Yes" << endl; else cout << "No" << endl; }