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