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

Gen = Array.new(N+1, 0)
Gen[0] = 1
nxt = Array.new(N+1, 0)
ls = S[0]
ans = true
S.each{|s|
  if ls != s then
    wk = 0
    (N+1).times{|i|
      wk += nxt[i]
      next if wk == 0
      nxt[i] = 0
      Gen[i] += wk
    }
  end
  ls = s
  idx = Gen.index{|g| g != 0}
  (ans = false; break) if idx.nil?
  Gen[idx] -= 1
  nxt[idx + 1] += 1 if idx < N
}

puts ans ? 'Yes' : 'No'
