#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long flag = 0, ct = 0;
  long long a = 0;
  if (n == 1 && s[0] == '0') {
    cout << "No";
    return 0;
  }
  if (s[0] == '0' && s[1] == '0' || s[n - 1] == '0' && s[n - 2] == '0') {
    cout << "No";
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == '1') {
      if (i + 1 < n && s[i + 1] == '1') {
        flag = 1;
        break;
      }
    }
    if (s[i] == '0') {
      if (i + 1 < n && s[i + 1] == '0' && i + 2 < n && s[i + 2] == '0')
        flag = 1;
    }
  }
  if (flag)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
