import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip, std.regex;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.chomp;

    foreach (i; 0..N-1) {
        if (A[i] == '1' && A[i+1] == '1') {
            writeln("No");
            return;
        }
    }

    foreach (i; 0..N) {
        if (A[i] == '1') continue;
        bool ok1  = (i == 0)   || (i > 0   && A[i-1] == '0');
        bool ok2  = (i == N-1) || (i < N-1 && A[i+1] == '0');
        if (ok1 && ok2) {
            writeln("No");
            return;
        }
    }

    writeln("Yes");
}
