#include <bits/stdc++.h>
using namespace std;
bool isOk(string s) {
  for (long long i = 0; i + 1 < s.size(); i++) {
    if (s[i] == '1' && s[i + 1] == '1') {
      return false;
    }
  }
  return true;
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  if (!isOk(s)) {
    puts("No");
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    string tmp = s;
    if (tmp[i] == '0') {
      tmp[i] = '1';
      if (isOk(tmp)) {
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  return 0;
}
