import Control.Monad

main = do
    n <- readLn
    xs <- replicateM n getLine
    if foldl (&&) True $ map ((>0) . foldl1 (\a b -> if (a-10) < 0 then 0 else max (a-10) b) . map read) [xs, reverse xs]
        then putStrLn "yes"
        else putStrLn "no"

