#include <bits/stdc++.h>
using namespace std;
int n, a[1007];
bool check() {
  for (int i = 1; i < n; ++i)
    if (a[i] && a[i + 1]) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%1d", &a[i]);
  if (!check())
    printf("No");
  else {
    int ok = 1;
    for (int i = 1; i <= n; ++i)
      if (!a[i]) {
        a[i] = 1;
        if (check()) ok = 0;
        a[i] = 0;
      }
    if (ok)
      printf("Yes");
    else
      printf("No");
  }
}
