#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000 + 10;
int N, A[Maxn];
char s[Maxn];
int main() {
  scanf("%d", &N);
  scanf("%s", s);
  for (int i = 1; i <= N; ++i) A[i] = s[i - 1] - '0';
  for (int i = 1; i <= N; ++i) {
    if (!A[i] && !A[i - 1] && !A[i + 1]) {
      puts("No");
      return 0;
    }
    if (A[i] && (A[i - 1] || A[i + 1])) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}
