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 = decrease (y:hs)
         | x >= y - 1 = decrease (y - 1:hs)
         | x < y  = False
         | otherwise = False

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

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