#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
  int n;
  string str;
  cin >> n >> str;
  int len = str.length();
  for (int i = (0); i <= (len - 1); ++i) {
    if (str[i] == '0') {
      int oneCnt = 0;
      if (i - 1 >= 0) oneCnt += str[i - 1] == '1';
      if (i + 1 < len) oneCnt += str[i + 1] == '1';
      if (oneCnt == 0) {
        cout << "No" << endl;
        return 0;
      }
    } else {
      int oneCnt = 0;
      if (i - 1 >= 0) oneCnt += str[i - 1] == '1';
      if (i + 1 < len) oneCnt += str[i + 1] == '1';
      if (oneCnt != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
