#include <bits/stdc++.h>
using namespace std;
long long n, k, a, ans, i, b[10000000];
string s, s1;
int main() {
  cin >> n >> s;
  s1 = '0';
  s1 += s;
  s1 += '0';
  s = s1;
  a = s.find("11");
  if (a < 10000) return cout << "No", 0;
  a = s.find("000");
  if (a < 10000) return cout << "No", 0;
  cout << "Yes";
}
