#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  bool flag = true;
  int ctr = 0;
  int ctr1 = 0;
  int is_one_present = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0') {
      ctr++;
      ctr1 = 0;
    } else {
      ctr = 0;
      ctr1++;
      is_one_present++;
    }
    if (ctr > 2) flag = false;
    if (ctr1 > 1) flag = false;
  }
  if (s.length() >= 2) {
    if (s[n - 1] == '0' && s[n - 2] == '0') flag = false;
    if (s[0] == '0' && s[1] == '0') flag = false;
  }
  if (flag == true && is_one_present > 0)
    cout << "Yes";
  else
    cout << "No";
}
