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"

compute :: Int -> [Int] -> Bool
compute n ss = loop 1
  where
    kend = 2^n
    sss = sortBy (flip compare) ss
    loop k
      | k == kend = True
      | True = and (zipWith (>) as bs) && loop (k*2)
      where
        (as,bs) = splitAt k sss
-- asは次からもう比較する必要はない。新たなtake k bsの部分だけでいい。