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