import Control.Applicative
main = do
    n <- getLine
    a <- map read . words <$> getLine
    putStrLn $ solve a
solve :: [Int] -> String
solve list = if judge tuple then "Yes" else "No"
    where tuple = count list

powerTwo :: Int -> Int -> Int
powerTwo n x = if r==0 then powerTwo (n+1) q else n
    where (q,r) = divMod x 2

count :: [Int] -> (Int,Int,Int)
count = foldl f (0,0,0)
    where f (x,y,z) n = case powerTwo 0 n of 0 -> (x+1,y,z)
                                             1 -> (x,y+1,z)
                                             _ -> (x,y,z+1)
judge :: (Int,Int,Int) -> Bool
judge (x,y,z) = if y>=1
                then x<=z
                else x<=z+1