#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n >> s;
  s = '0' + s + '0';
  if (s.find("11") == -1 && s.find("000") == -1)
    puts("Yes");
  else
    puts("No");
  return 0;
}
