#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t, k, n;
  cin >> n;
  string st;
  cin >> st;
  for (i = 0; i < n; i++) {
    if (st[i] == '0' && (st[i - 1] != '1' && st[i + 1] != '1')) {
      cout << "No" << endl;
      return 0;
    } else if ((st[i - 1] == '1' && st[i] == '1')) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
