#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  string s, t;
  cin >> s;
  t = s;
  reverse(t.begin(), t.end());
  if (s.find("11") != -1 || s.find("000") != -1 || s.find("00") == 0 ||
      t.find("00") == 0 || (n == 1 && s[0] == '0')) {
    cout << "No";
  } else {
    cout << "Yes";
  }
  return 0;
}
