output_description: If it is possible to set the healths of the first slime and the subsequent
  slimes spawn so that the multiset of the healths of the 2^N slimes that will
  exist in N seconds equals S, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      S_1 S_2 ... S_{2^N}
attempt: n = int(input())
  a = [int(i) for i in input().split()]
  # a.sort(reverse=True)
  s = 0
  ans = 1
  # print(a)
  # for i in range(n):
  # for j in range(2**i):
  # print(i," ",a[j],a[2**i+j],j,2**i+j)
  #  if(a[j]<=a[2**i+j]):
  #   ans=0
  #  break
  # if(ans==0): break
  print("No")
  # if ans==1:print("Yes")
  # else:print("No")
  
problem_description: Statement
  
  We have one slime.
  
  You can set the _health_ of this slime to any integer value of your choice.
  
  A slime reproduces every second by spawning another slime that has strictly
  less health. You can freely choose the health of each new slime. The first
  reproduction of our slime will happen in one second.
  
  Determine if it is possible to set the healths of our first slime and the
  subsequent slimes spawn so that the multiset of the healths of the 2^N slimes
  that will exist in N seconds equals a multiset S.
  
  Here S is a multiset containing 2^N (possibly duplicated) integers:
  S_1,~S_2,~...,~S_{2^N}.
samples: [{"input": "2\n    4 2 3 1", "output": "Yes\n    \n\nWe will show one way to make the multiset of the healths of the slimes that\nwill exist in 2 seconds equal to S.\n\nFirst, set the health of the first slime to 4.\n\nBy letting the first slime spawn a slime whose health is 3, the healths of the\nslimes that exist in 1 second can be 4,~3.\n\nThen, by letting the first slime spawn a slime whose health is 2, and letting\nthe second slime spawn a slime whose health is 1, the healths of the slimes\nthat exist in 2 seconds can be 4,~3,~2,~1, which is equal to S as multisets.\n\n* * *"}, {"input": "2\n    1 2 3 1", "output": "Yes\n    \n\nS may contain multiple instances of the same integer.\n\n* * *"}, {"input": "1\n    1 1", "output": "No\n    \n\n* * *"}, {"input": "5\n    4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3", "output": "No"}]