#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 + 10;
int n, m;
char ch[2000];
inline int in() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * flag;
}
int main() {
  cin >> n;
  int cnt = 0, last = -1;
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    ch[i] = getchar();
    while (ch[i] < '0' || ch[i] > '1') ch[i] = getchar();
    if (i > 1 && ch[i] == '1' && ch[i - 1] == '1') flag = false;
  }
  if (n == 1 && ch[1] == '0') flag = false;
  for (int i = 1; i <= n; i++) {
    if (i == 1 && ch[i] == '0' && ch[i + 1] == '0') flag = false;
    if (i == n && ch[i] == '0' && ch[i - 1] == '0') flag = false;
    if (i > 1 && i < n && ch[i] == '0' && ch[i - 1] == '0' && ch[i + 1] == '0')
      flag = false;
  }
  if (!flag) {
    printf("No");
  } else {
    printf("Yes");
  }
  return 0;
}
