import Control.Applicative
import Control.Monad
import Data.List
import Data.Array

main = do
  n <- (read::String -> Int) <$> getLine
  arr <- map (read::String -> Int) . words <$> getLine
  if solve arr (minBound::Int)
    then putStrLn "Yes"
    else putStrLn "No"



solve::[Int] -> Int -> Bool
solve (x:y:xs) maximum
  | x > y && maximum >= y + 2 = False
  | otherwise = solve (y:xs) $ max maximum y
solve (x:xs) maximum = True
