import Control.Monad
import Data.Bool
import Data.Char
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as M
main=putStrLn.solve.unfoldr(B.readInt.B.dropWhile isSpace)=<<B.getContents
solve(n:ss)=bool"No""Yes"$f[v]$M.fromListWith(+)$zip vs$repeat 1 where
  (v:vs)=sortOn(0-)$ss
f vs m
  |null m=True
  |otherwise=maybe False(uncurry f)$foldM g(vs,m)vs
g(vs,m)v=case M.lookupLT v m of
  Just(u,i) -> Just$(u:vs,bool(M.delete u m)(M.insert u(i-1)m)(i>1))
  Nothing -> Nothing