import qualified Data.ByteString.Char8 as C
 
main = do
  C.getLine
  as <- map read . C.words <$> C.getLine
  putStr $ f 0 0 0 as
 
f x y z []
  | y + 2 > x + z = "Yes"
  | otherwise = "No"
f x y z (0:as) = f x (succ y) z as
f x y _ (2:as) = f x y 1 as
f x y z (_:as) = f (succ x) y z as