#include <bits/stdc++.h>
char c = '1';
using namespace std;
int main() {
  int n;
  int b = 1;
  cin >> n;
  string s;
  cin >> s;
  if (n == 1) {
    cout << (s[0] == '0' ? "No" : "Yes");
    return 0;
  } else {
    for (int i = 0; i < n; i++) {
      if (b == 1 && s[i] == '0') {
        b = 2;
      } else if (b == 2 && s[i] == '0') {
        cout << "No";
        return 0;
      } else if (s[i] == '0')
        b = 1;
      else {
        b = 0;
        if (i && s[i] == '1' && s[i - 1] == '1') {
          cout << "No";
          return 0;
        }
      }
    }
    if (b == 2) {
      cout << "No";
      return 0;
    }
    cout << "Yes";
  }
}
