#include <bits/stdc++.h>
long long mod = 1e9 + 7;
const int MAX = 1e5 + 5;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '1' && s[i + 1] == '1') {
      cout << "No";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      s[i] = '1';
      int flag = 0;
      for (int j = 0; j < n - 1; j++) {
        if (s[j] == '1' && s[j + 1] == '1') {
          flag = 1;
          continue;
        }
      }
      if (flag == 0) {
        cout << "No";
        return 0;
      }
      s[i] = '0';
    }
  }
  cout << "Yes";
  return 0;
}
