local mfl, mce = math.floor, math.ceil
local mmi, mma = math.min, math.max
local bls, brs = bit.lshift, bit.rshift
local SegTree = {}
SegTree.updateAll = function(self)
  for i = self.stagenum - 1, 1, -1 do
    local cnt = bls(1, i - 1)
    for j = 1, cnt do
      self.stage[i][j] = self.func(self.stage[i + 1][j * 2 - 1], self.stage[i + 1][j * 2])
    end
  end
end
SegTree.create = function(self, n, func, emptyvalue)
  self.func, self.emptyvalue = func, emptyvalue
  local stagenum, mul = 1, 1
  self.stage = {{}}
  while mul < n do
    mul, stagenum = mul * 2, stagenum + 1
    self.stage[stagenum] = {}
  end
  self.stagenum = stagenum
  self.left_stage = {}
  for i = 1, n do
    local sp, sz = 1, bls(1, stagenum - 1)
    while(i - 1) % sz ~= 0 do
      sp, sz = sp + 1, brs(sz, 1)
    end
    self.left_stage[i] = sp
  end
  self.sz_stage = {}
  local tmp, sp = 1, stagenum
  for i = 1, n do
    if tmp * 2 == i then tmp, sp = tmp * 2, sp - 1 end
    self.sz_stage[i] = sp
  end
  for i = 1, mul do self.stage[stagenum][i] = emptyvalue end
  self:updateAll()
end
SegTree.lower_bound = function(self, val)
  local ret, retpos = self.emptyvalue, 0
  local stagenum = self.stagenum
  local stage, l, r = 1, 1, bls(1, stagenum - 1)
  while true do
    local sz = bls(1, stagenum - stage)
    local tmp = self.func(ret, self.stage[stage][mce(l / sz)])
    if tmp < val then
      ret, retpos = tmp, l + sz - 1
      if l + sz <= r then stage, l = stage + 1, l + sz
      else break
      end
    else
      if sz ~= 1 then stage, r = stage + 1, l + sz - 2
      else break
      end
    end
  end
  return retpos + 1
end
SegTree.setValue = function(self, idx, value)
  self.stage[self.stagenum][idx] = value
  for i = self.stagenum - 1, 1, -1 do
    local dst = brs(idx + 1, 1)
    local rem = dst * 4 - 1 - idx
    self.stage[i][dst] = self.func(self.stage[i + 1][idx], self.stage[i + 1][rem])
    idx = dst
  end
end
SegTree.new = function(n, func, emptyvalue)
  local obj = {}
  setmetatable(obj, {__index = SegTree})
  obj:create(n, func, emptyvalue)
  return obj
end
local inf = 1000000007
local n = io.read("*n")
local tot = bls(1, n)
local t = {}
local idx = {}
local childcnt = {}
local capacity = {}
for i = 1, tot do
  t[i] = io.read("*n")
  idx[i] = i
  childcnt[i] = 0
  capacity[i] = -1
end
table.sort(t)
local parent = {0}
local len = {0}
for i = 1, n do
  local sn = bls(1, i - 1)
  for j = 1, sn do
    childcnt[j] = childcnt[j] + 1
    parent[j + sn] = j
    len[j + sn] = len[j] + 1
  end
end
table.sort(idx, function(a, b) return len[a] > len[b] end)
local invidx = {}
for i = 1, tot do
  invidx[i] = i
end
for i = 1, tot do
  invidx[idx[i]] = i
end
-- print(table.concat(parent, " "))
-- print(table.concat(len, " "))
-- print(table.concat(idx, " "))

local st = SegTree.new(tot, mma, -inf)
for i = 1, tot do
  if childcnt[i] == 0 then
    st:setValue(invidx[i], -1)
  end
end
local valid = true
for i = 1, tot do
  local stpos = st:lower_bound(-t[i])
  if tot < stpos then valid = false break end
  st:setValue(stpos, -inf)
  local src = idx[stpos]
  if i ~= tot then
    local p = parent[src]
    -- print(stpos, src, p)
    local stp = invidx[p]
    capacity[p] = mmi(capacity[p], -t[i] - 1)
    childcnt[p] = childcnt[p] - 1
    if childcnt[p] == 0 then
      st:setValue(stp, capacity[p])
    end
  end
end
print(valid and "Yes" or "No")
