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