#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0;
  string s;
  cin >> n >> s;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] == '1' && s[i - 1] == s[i]) return cout << "No", 0;
  }
  s = "0" + s + "0";
  if (s.find("000") != string::npos) return cout << "No", 0;
  cout << "Yes";
  return 0;
}
