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 i = 1;
    foreach (_; 0..N) {
        foreach (j; 0..2^^(i-1)) {
            if (S[i+j] >= S[j]) {
                writeln("No");
                return;
            }
        }
        i *= 2;
    }
    writeln("Yes");
}