import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

--Input functions with ByteString
readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine


decrease :: [Integer] -> [Bool]
decrease [h] = [True]
decrease (x:y:hs)
         | x >= y = [True] ++ decrease (y:hs)
         | x >= y - 1 = [True] ++ decrease (y - 1:hs)
         | x < y  = [False]
         | otherwise = [False]

buildStairs :: Integer -> [Integer] -> String
buildStairs n h = if foldr (&&) True $decrease (reverse h) then "Yes" else "No"

main = do
     n <- getInt
     h <- getIntList
     print $ buildStairs n h
