{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe

main :: IO ()
main = do
  n <- readLn :: IO Int
  getLine >>= putStrLn . solve . map read . words

solve :: [Int] -> String
solve hs = if isNothing $ foldM f 0 hs
           then "No"
           else "Yes"
  where
    f prev x = if prev == x
               then Just x
               else if prev <= x - 1
                    then Just (x - 1)
                    else Nothing