#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j;
  long long N;
  cin >> N;
  string str;
  cin >> str;
  if (N == 1) {
    if (str == "0")
      cout << "No";
    else
      cout << "Yes";
    return 0;
  }
  if ((str[0] == '0' && str[1] == '0') ||
      (str[N - 1] == '0' && str[N - 2] == '0')) {
    cout << "No";
    return 0;
  }
  vector<long long> v;
  for (i = 0; i < N; i++) {
    if (str[i] == '1') v.push_back(i);
  }
  for (i = 0; i < v.size() - 1; i++) {
    if (v[i + 1] - v[i] != 2 && v[i + 1] - v[i] != 3) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
