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