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

void main(){
  int n = readln.chomp.to!int;
  int[] as = readln.chomp.split.to!(int[]);

  as.sort!"a>b"();
  stderr.writeln("as:", as);

  string ans = "Yes";
  for(long m = 1; m < (1L << n); m *= 2)
      foreach(i; 0 .. m){
           if (as[i] == as[i + m]) ans = "No";
           stderr.writeln("m:", m, " i:", i, " a:", as[i], " b:", as[i + m], " ans:", ans);
      }
    
  ans.writeln;
}