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