#include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    scanf("%s", s + 1);
    s[0] = s[n + 1] = '0';
    int blag = 0;
    for (int i = 1; i <= n; i++)
      if ((s[i - 1] == '0' && s[i] == '0' && s[i + 1] == '0') ||
          (s[i] == '1' && s[i + 1] == '1'))
        blag = 1;
    printf("%s\n", blag ? "No" : "Yes");
  }
  return 0;
}
