#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k;
  string str;
  cin >> n;
  cin >> str;
  long long int pos[n + 2];
  pos[0] = pos[n + 1] = 0;
  for (i = 1; i <= n; i++) {
    pos[i] = str[i - 1] - '0';
  }
  bool valid = 1;
  for (i = 2; i <= n; i++) {
    if (pos[i] == pos[i - 1] && pos[i - 1] == 1) {
      valid = 0;
      break;
    }
  }
  if (!valid) {
    cout << "No" << endl;
    return 0;
  }
  for (i = 1; i <= n; i++) {
    if (pos[i] == 0 && pos[i - 1] == pos[i + 1] && pos[i - 1] == 0) {
      valid = 0;
    }
  }
  if (!valid) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
