#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n;
  while (cin >> n) {
    int ans = 0, x, y, tmp;
    string s;
    cin >> s;
    bool l = 1;
    for (int i = n - 1; i >= 0; --i) s[i + 1] = s[i];
    s[0] = '0';
    s[n + 1] = '0';
    for (int i = 1; i <= n; ++i) {
      if (s[i] == '0') {
        if (s[i + 1] == '0' && s[i - 1] == '0') l = 0;
      }
      if (s[i] == '1') {
        if (s[i + 1] == '1' || s[i - 1] == '1') l = 0;
      }
    }
    if (l)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
