#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  string s;
  cin >> n >> s;
  s = '0' + s + '0';
  if (s.find("000") == string::npos && s.find("11") == string::npos)
    cout << "Yes";
  else
    cout << "No";
}
