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