#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  s = "0" + s + "0";
  if (s.find("000") == -1 && s.find("11") == -1)
    printf("Yes\n");
  else
    printf("No\n");
}
