#include <bits/stdc++.h>
using namespace std;
int main() {
  int len;
  string str;
  cin >> len;
  cin >> str;
  if (len == 1) {
    if (str[0] == '1')
      puts("Yes");
    else
      puts("No");
    return 0;
  }
  for (int i = 1; i < len; i++) {
    if (str[i] == str[i - 1] && str[i] == '1') {
      puts("No");
      return 0;
    }
  }
  for (int i = 2; i < len; i++) {
    if (str[i] == str[i - 1] && str[i - 1] == str[i - 2] && str[i] == '0') {
      puts("No");
      return 0;
    }
  }
  if (str[0] == str[1] && str[0] == '0') {
    puts("No");
    return 0;
  }
  if (str[len - 1] == str[len - 2] && str[len - 1] == '0') {
    puts("No");
    return 0;
  }
  puts("Yes");
  return 0;
}
