#二分ヒープ
class BinaryHeap
  def initialize
    @heap = Array.new
    @size = 0
  end
  def push(x)
    me = @size
    @size += 1
    while 0 < me do
      parent = (me - 1) >> 1
      break if @heap[parent] <= x
        @heap[me] = @heap[parent]
        me = parent
    end
    @heap[me] = x
  end
  def shift
    wk = @heap[0]
    me = 0
    @size -= 1
    x = @heap[@size]
    while me < @size do
      child = (me << 1) + 1
      break if child >= @size
      if (child + 1) < @size && (@heap[child + 1] <= @heap[child]) then
        child += 1
      end
      break if x <= @heap[child]
      @heap[me] = @heap[child]
      me = child
    end
    @heap[me] = x
    wk
  end
  def first
    @size == 0 ? nil : @heap[0]
  end
  def empty?
    @size == 0
  end
end

N = gets.to_i
S = gets.chomp.split(" ").map(&:to_i)

S.sort!.reverse!
max_size = 2 ** N
C = Hash.new{|h, k| h[k] = BinaryHeap.new}
C[S[0]].push(0)
ans = true
(1...S.size).each{|i|
  s = S[i]
  idx = C.keys.select{|k| k > s}.min_by{|k| C[k].first}
  (ans = false; break) if idx.nil?
  j = C[idx].shift
  wk = 2 * j + 2
  if wk < max_size then
    C[idx].push(wk - 1)
    C[s].push(wk)
  else
    C.delete(idx) if C[idx].empty?
  end
}

puts ans ? 'Yes' : 'No'
