#include <bits/stdc++.h>
using namespace std;
const int N = 30;
const int inf = 0x3f3f3f3f;
string str;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    cin >> str;
    str = '0' + str + '0';
    int sign = 1;
    for (int i = 0; i < str.length() - 1; i++) {
      if (str[i] == '1') {
        if (str[i + 1] == '1') {
          sign = 0;
          break;
        }
      } else {
        if (str[i + 1] == '0' && str[i + 2] == '0') {
          sign = 0;
          break;
        }
      }
    }
    if (sign)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
