import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List

main = do
  BS.getLine
  li <- BS.getLine
  let ss = unfoldr (BS.readInt . BS.dropWhile isSpace) li
  let ans = compute ss
  putStrLn $ if ans then "Yes" else "No"

{-
greedyに自分より大きな要素を見つけて自分は消える、で要素が半分になることを
要素が1になるまで繰り返せれば成功、かしら。
-}
compute :: [Int] -> Bool
compute ss = looop (loop $ sort ss)
  where
    loop [] = Just []
    loop (x:xs) =
      case span (x >=) xs of
        (as,b:bs) -> loop (as++bs) >>= return . (b :)
        _ -> Nothing
    looop Nothing = False
    looop (Just [_]) = True
    looop (Just xs) = looop (loop xs)
