import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    auto S = readln.split.to!(int[]);
    sort!"a > b"(S);
    int[] NS;
    {
        int last, c;
        foreach (s; S) {
            if (s == last) {
                ++c;
            } else {
                NS ~= c;
                c = 1;
                last = s;
            }
        }
        NS ~= c;
    }

    auto ts = [2^^N];
    foreach (ns; NS) {
        auto c = ns;

        if (ts.length < c) {
            writeln("No");
            return;
        }

        auto ss = ts[0..c];
        ts = ts[c..$];
        foreach (s; ss) {
            s /= 2;
            while (s) {
                ts ~= s;
                s /= 2;
            }
        }
        sort!"a > b"(ts);
    }
    writeln("Yes");
}