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