#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  cin >> n;
  string str;
  cin >> str;
  int sum = 0, flag = 0;
  if (n == 1 and str[0] == '0') {
    cout << "No" << endl;
    return 0;
  } else if (n == 1 and str[0] == '1') {
    cout << "Yes" << endl;
    return 0;
  }
  if (str[0] == '1' and str[1] == '1')
    flag = 1;
  else if (str[0] == '0' and str[1] == '0')
    flag = 1;
  else if (str[str.size() - 2] == '1' and str[str.size() - 1] == '1')
    flag = 1;
  else if (str[str.size() - 2] == '0' and str[str.size() - 1] == '0')
    flag = 1;
  if (flag == 0) {
    for (i = 0; i < str.size() - 1; i++) {
      if (str[i] == '1' and str[i + 1] == '1') flag = 1;
    }
    for (i = 0; i < str.size() - 2; i++) {
      if (str[i] == '0' and str[i + 1] == '0' and str[i + 2] == '0') flag = 1;
    }
  }
  if (flag == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
