import std.stdio, std.algorithm, std.string;

void main()
{
    readln();
    auto s = readln().strip();

    bool ok = true;
    ok &= !canFind(s, "000");
    ok &= !canFind(s, "11");
    ok &= !s.startsWith("00");
    ok &= !s.endsWith("00");
    ok &= s != "0";

    writeln(ok ? "Yes" : "No");
}