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