#include <bits/stdc++.h>
using namespace std;
int n, l, p = -2;
string a;
int main() {
  scanf("%d", &n);
  cin >> a;
  l = a.length();
  for (int i = 0; i < l; ++i)
    if (a[i] == '1') {
      if (i - p == 1 || i - p > 3)
        return printf("No"), 0;
      else
        p = i;
    }
  if (l - p - 1 >= 2 || p == -1) return printf("No"), 0;
  return printf("Yes"), 0;
}
