#include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline void filehandling() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  filehandling();
  string str1, str2;
  ll n;
  cin >> n;
  string s;
  cin >> s;
  if (n == 1 && s[0] == '0') {
    cout << "No\n";
    return 0;
  }
  bool error = 0;
  bool flag = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '1' && (i != n - 1 && s[i + 1] == '1')) error = 1;
    if ((i == 0 || s[i - 1] == '0') && s[i] == '0' &&
        (i == n - 1 || s[i + 1] == '0'))
      error = 1;
  }
  if (error)
    cout << "No\n";
  else
    cout << "Yes\n";
  return 0;
}
