#二分ヒープ
class BinaryHeap
  def initialize
    @heap = Array.new
    @size = 0
  end
  def push(x)
    @size += 1
    upfrom(@size - 1, x)
  end
  def shift
    wk = @heap[0]
    @size -= 1
    downfrom(0, @heap[@size])
    wk
  end
  def change(o, n)
    i = @heap.find_index{|h| h == o}
    return if i.nil?
    if i == 0 || (o <= n) then
      downfrom(i, n)
    else
      upfrom(i, n)
    end
  end
  def delete(x)
    i = @heap.find_index{|h| h == x}
    return if i.nil?
    @size -= 1
    downfrom(i, @heap[@size])
  end
  def first
    @size == 0 ? nil : @heap[0]
  end
  def second
    if @size < 2 then
      nil
    elsif @size == 2 then
      @heap[1]
    else
      @heap[1] <= @heap[2] ? @heap[1] : @heap[2]
    end
  end
  def empty?
    @size == 0
  end

  private

  def upfrom(i, x)
    me = i
    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 downfrom(i, x)
    me = i
    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
  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)
CI = BinaryHeap.new
CI.push(0)
P = Array.new(2 ** (N + 1) - 1)
P[0] = S[0]
ans = true
(1...S.size).each{|i|
  s = S[i]
  j = CI.first
  j = CI.second if P[j] == s
  (ans = false; break) if j.nil?
  k = P[j]
  jj = C[k].shift
  wk = 2 * j + 2
  if wk < max_size then
    C[k].push(wk - 1)
    CI.change(j, C[k].first)
    P[wk - 1] = k
    C[s].push(wk)
    CI.push(wk) if C[s].second.nil?
    P[wk] = s
  else
    (C.delete(k); CI.delete(j)) if C[k].empty?
  end
}

puts ans ? 'Yes' : 'No'
