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

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

{-
greedyに小さいものから二分木の葉の方に並べていければいい。つまり、
大きい順にした配列が、2nと2n+1を使うヒープとして正しければいい。
-}
compute :: Int -> [Int] -> Bool
compute n ss = loop 1 [head sss] (tail sss)
  where
    sss = sortBy (flip compare) ss
    loop _ _ [] = True
    loop k xs ys = check xs as && loop k2 as bs
      where
        k2 = k*2
        (as,bs) = splitAt k2 ys

check (x:xs) (y:z:ys) = x > y && x > z && check xs ys
check _ _ = True