#include <bits/stdc++.h>
using namespace std;
const int N = 100007;
int main() {
  long long int n, cnt = 0, i, j;
  string s;
  cin >> n >> s;
  i = 0;
  if (n == 1 && s[0] == '0') {
    cout << "No\n";
    return 0;
  }
  if (s[0] == '0' && s[1] == '0') {
    cout << "No\n";
    return 0;
  }
  while (i < n) {
    if (i < n - 1 && s[i] == '1' && s[i + 1] == '1') {
      cout << "No\n";
      return 0;
    } else if (i < n - 2 && s[i] == '0' && s[i + 1] == '0' && s[i + 2] == '0') {
      cout << "No\n";
      return 0;
    }
    i++;
  }
  if (s[n - 2] == '0' && s[n - 1] == '0')
    cout << "No\n";
  else
    cout << "Yes\n";
  return 0;
}
