#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  if (n == 1) {
    if (s == "1")
      printf("Yes\n");
    else
      printf("No\n");
    return 0;
  }
  if (n == 2) {
    if (s == "00" || s == "11")
      printf("No\n");
    else
      printf("Yes\n");
    return 0;
  }
  for (int i = 0; i < s.size(); i++) {
    if ((i + 1) < n && s[i] == '1' && s[i + 1] == '1') {
      printf("No\n");
      return 0;
    }
    if ((i + 2) < n && s[i] == '0' && s[i + 1] == '0' && s[i + 2] == '0') {
      printf("No\n");
      return 0;
    }
  }
  if ((s[n - 1] == '0' && s[n - 2] == '0') || (s[0] == '0' && s[1] == '0'))
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
