#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, f;
  cin >> n;
  char *s = NULL;
  s = (char *)malloc((n + 1) * sizeof(char));
  if (n % 2 == 0)
    f = n / 2;
  else
    f = n / 2 + 1;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == s[i + 1] && s[i] != '0' && s[i + 1] != '0') {
      cout << "No";
      return 0;
    }
    if (i == 0) {
      if (s[0] == '0' && s[1] == '0') {
        cout << "No";
        return 0;
      }
    }
    if (i != 0) {
      if (s[i - 1] == '0' && s[i] == '0' && s[i + 1] == '0') {
        cout << "No";
        return 0;
      }
    }
  }
  if (2 <= n && s[n - 1] == '0' && s[n - 2] == '0') {
    cout << "No";
    return 0;
  }
  if (n == 1 && s[0] != '1') {
    cout << "No";
    return 0;
  }
  cout << "Yes";
  free(s);
  s = NULL;
  return 0;
}
