#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, fl = 0;
  string s1;
  cin >> n;
  cin >> s1;
  if (n == 1 && s1[0] == '0') {
    cout << "No";
    return 0;
  }
  if (n == 1 && s1[0] == '1') {
    cout << "Yes";
    return 0;
  }
  if (n == 2 && s1[0] == '0' && s1[1] == '0') {
    cout << "No";
    return 0;
  }
  if (n == 2 && s1[0] == '1' && s1[1] == '1') {
    cout << "No";
    return 0;
  }
  if (n == 2) {
    cout << "Yes";
    return 0;
  }
  if (s1[n - 1] == '0' && s1[n - 2] == '0') {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < s1.size() - 1; i++) {
    if (s1[i] == '1' && s1[i + 1] == '1') {
      cout << "No";
      return 0;
    }
    if (s1[i] == '0') {
      if (i > 0 && s1[i - 1] == '1') continue;
      if (s1[i + 1] == '1') continue;
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
