#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("trapv")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
const int MAXN = 4e5 + 500;
const int MAXK = 12;
const long long int INF = 2000000000;
const int RANDOM =
    chrono::high_resolution_clock::now().time_since_epoch().count();
long long int expo_pow(long long int x, long long int y) {
  if (y == 0) return 1;
  y = y % ((1000000007) - 1);
  x %= (1000000007);
  if (y == 0) y = (1000000007) - 1;
  long long int res = 1;
  while (y) {
    if (y & 1) res = (res * x) % (1000000007);
    x = (x * x) % (1000000007);
    y >>= 1;
  }
  return res;
}
long long int modInverse(long long int a, long long int m = (1000000007)) {
  return expo_pow(a, m - 2);
}
void solve(int te) {
  int n;
  cin >> n;
  string second;
  cin >> second;
  if (n == 1) {
    if (second[0] - '0') {
      cout << "Yes" << '\n';
    } else
      cout << "No" << '\n';
    return;
  }
  for (int i = (0); i < (n); i++) {
    if (second[i] == '1') {
      if (i) {
        if (second[i] == '1' && second[i - 1] == '1') {
          cout << "No" << '\n';
          return;
        }
      }
    } else {
      if (i >= 1) {
        if (second[i - 1] == '0') {
          if (i - 2 < 0 || second[i - 2] == '0' || i + 1 >= n) {
            cout << "No" << '\n';
            return;
          }
        }
      }
    }
  }
  cout << "Yes" << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  int t = 1;
  while (t <= T) {
    solve(t);
    t++;
  }
}
