#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
const double EPS = 1e-8;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
string s;
int n;
int main() {
  ios::sync_with_stdio(false);
  while (cin >> n >> s) {
    int ok = 1;
    if (n != 1) {
      for (int i = 0; i < (int)s.length() - 1; i++) {
        if (s[i] == '1' && s[i + 1] == '1') {
          ok = 0;
          break;
        }
      }
      if (ok) {
        for (int i = 0; i < (int)s.length() - 1; i++) {
          if (i - 1 >= 0 && i + 1 < n && s[i - 1] == '0' && s[i + 1] == '0' &&
              s[i] == '0') {
            ok = 0;
            break;
          }
        }
        if (ok) {
          if ((s[0] == '0' && s[1] == '0') ||
              (s[n - 2] == '0' && s[n - 1] == '0')) {
            ok = 0;
          }
        }
      }
    }
    if (n == 1 && s == "0") ok = 0;
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
