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