#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int n;
  cin >> n;
  char c;
  int cont = 0;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    s.push_back(c);
  }
  if (n == 1 && s[0] == '0') {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (i == 0) {
      if (s[i] == '0') cont++;
      if (s[i] == '0' && s[i + 1] == '0') {
        cout << "No" << endl;
        return 0;
      }
    } else if ((i > 0) && (i < n - 1)) {
      if (s[i] == '0') {
        cont++;
        if (cont >= 3) {
          cout << "No" << endl;
          return 0;
        }
      } else if ((s[i] == '1') && (s[i - 1] != '1')) {
        cont = 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    } else if (i == n - 1) {
      if ((s[n - 1] == '0') && (s[n - 2] == '0')) {
        cout << "No" << endl;
        return 0;
      } else if (s[n - 1] == '1' && s[n - 2] == '1') {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
