{-# LANGUAGE MultiWayIf #-}
module Main where
import Data.List (foldl1')
import qualified Data.IntMap.Strict as M
import Debug.Trace

solve :: Int -> M.IntMap Int -> Bool
solve (-1) m = sum m == 1
solve count m = case iter (2^count) trim m [] of
  Nothing -> False
  Just (xs, m') -> solve (count - 1) $ M.unionWith (+)
    (M.fromListWith (+) (map (flip (,) 1) xs))
    m'

iter :: Int -> (a -> Maybe (b, a)) -> a -> [b] -> Maybe ([b], a)
iter 0 _ a xs = Just (xs, a)
iter n f a xs = f a >>= \(b, a') -> iter (n - 1) f a' (b : xs)

trim :: M.IntMap Int -> Maybe (Int, M.IntMap Int)
trim m = case M.minViewWithKey m of
  Just ((k, v), m') -> case M.lookupGT k m' of
    Nothing -> Nothing
    Just (k', w) -> Just $ (,) (succ k') $ case () of
      _ | v == 1, w == 1 -> M.delete k' m'
        | w == 1 -> M.insert k (v - 1) $ M.delete k' m'
        | v == 1 -> M.insert k' (w - 1) m'
        | otherwise -> M.insert k (v - 1) $ M.insert k' (w - 1) m'
  Nothing -> Nothing

main = do
  n <- readLn
  xs <- M.fromListWith (+) . map (flip (,) 1 . read) . words <$> getLine
  putStrLn $ if solve (n - 1) xs
    then "Yes"
    else "No"
