#include using namespace std; int main() { iostream::sync_with_stdio(0), cin.tie(0), cout.tie(0); string n; cin >> n; vector> P; for (char c: n) { int i = c - '0'; if (P.empty() || P.back().first != i) { P.push_back({i, 1}); } else { P.back().second++; } } bool ok = false; int sz = (int)P.size(); if (sz == 1 || sz == 2) { if (P.front().first == 1 && P.front().second > 1) { ok = true; } } else if (sz == 3) { if (P.front().first == 1 && P.front().second == 1 && P[1].second == 1) { ok = true; } if (P.front().first == 1 && P.front().second == 1 && P.back().first == 1 && P.back().second == 1) { ok = true; } } else if (sz == 4) { int cnt = 0; for (auto [i, c]: P) { if (i == 1) { cnt += c; } } if (cnt == 2) { ok = true; } } cout << (ok ? "Yes" : "No") << '\n'; return 0; }