#include <bits/stdc++.h>
using namespace std;
char s[1005] = {0};
int main() {
  int i, n;
  cin >> n;
  cin >> s;
  int x = 0;
  int flag = 0;
  for (i = 0; i < n; i++) {
    if (n == 1 && s[i] - '0' == 0) {
      flag = 1;
      break;
    }
    if (s[i] - '0' == 0) {
      x++;
      if (x >= 3) {
        flag = 1;
        break;
      }
      if (x == 2) {
        if (i == 1 || i == n - 1) {
          flag = 1;
          break;
        }
      }
    } else if (s[i] - '0' == 1) {
      x = 0;
      if (s[i - 1] - '0' == 1 || s[i + 1] - '0' == 1) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
