#include <bits/stdc++.h>
using namespace std;
void dfs(int u, int level, vector<vector<int> >& g, vector<int>& lvl) {
  lvl[u] = level;
  for (size_t i = 0; i != g[u].size(); ++i) {
    dfs(g[u][i], level + 1, g, lvl);
  }
}
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  string a = "0";
  cin >> a;
  a = "0" + a + "0";
  n += 2;
  for (size_t i = 0; i != n; ++i) {
    if ((i < n - 1 && (a[i] == '1' && a[i + 1] == '1')) ||
        (i < n - 2 && (a[i] == '0' && a[i + 1] == '0' && a[i + 2] == '0'))) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
