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