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