#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::fixed;
using std::ios_base;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::nth_element;
using std::pair;
using std::queue;
using std::reverse;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::tuple;
using std::unordered_map;
using std::unordered_set;
using std::vector;
const int MAXN = 100000;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int64_t L_INF = 4e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int n;
  string s;
  cin >> n >> s;
  s = "0" + s + "0";
  n += 2;
  for (int i = 0; i + 2 < n; i++) {
    if (s[i] == '0' && s[i + 1] == '0' && s[i + 2] == '0') {
      cout << "No\n";
      exit(0);
    }
  }
  for (int i = 0; i + 1 < n; i++) {
    if (s[i] == '1' && s[i + 1] == '1') {
      cout << "No\n";
      exit(0);
    }
  }
  cout << "Yes\n";
  return 0;
}
