#include <bits/stdc++.h>
using namespace std;
long long abs(long long a, long long b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
signed main() {
  long long TESTS = 1;
  while (TESTS--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long t = 0, i;
    if (s == "0" || s == "00")
      cout << "No" << endl;
    else {
      for (i = 0; i < n; i++) {
        if (s[i] == '0')
          t++;
        else if (s[i] == '1') {
          t = 0;
          if (i && s[i - 1] == '1') {
            break;
          }
        }
        if (t > 2) {
          break;
        } else if ((i == n - 1 || i == 1) && t == 2)
          break;
      }
      if (i == n)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
