#include <bits/stdc++.h>
using namespace std;
int main() {
  bool flag = false;
  int n;
  char chair[1010];
  cin >> n;
  cin >> chair;
  int i = 0;
  if (chair[i] == '0' && chair[i + 1] == '0') flag = true;
  int j = strlen(chair) - 2;
  if (chair[j] == '0' && chair[j + 1] == '0') flag = true;
  if (strlen(chair) == 1 && chair[0] == '0') flag = true;
  for (int i = 0; i < strlen(chair); i++) {
    if (chair[i] == '1' && chair[i + 1] == '1') {
      flag = true;
      break;
    } else if (chair[i] == '0' && chair[i + 1] == '0' && chair[i + 2] == '0') {
      flag = true;
      break;
    }
  }
  if (flag)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
