import java.util.*

fun readList() = readLine()!!.split(" ").map{it.toInt()}
fun removeOne(tree:TreeMap<Int,Int>,key:Int) = if(tree[key]==1)tree.remove(key) else tree.put(key,tree[key]!!-1)
fun main(args:Array<String>){
  val N = readLine()!!.toInt()
  val S = readList()
  val T = TreeMap<Int,Int>()
  for(x in S){
    T.put(x,(T[x]?:0)+1)
  }
  val A = mutableListOf<Int>()
  val last = T.lastKey()
  A += last
  removeOne(T,last)
  var answer = false
  var b = 1
  loop@ for(i in 0 until N){
    for(j in 0 until b){
      val c = T.lowerKey(A[j])
      if(c == null)break@loop
      A += c
      removeOne(T,c)
    }
    b *= 2
    if(i == N-1)answer = true
  }
  println(if(answer)"Yes" else "No")
}