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 0
    then putStrLn "Yes"
    else putStrLn "No"



solve::[Int] -> Int -> Bool
solve (x:y:xs) diff
  | x >= y + 2 = False
  | x == y + 1 && diff == 1 = False
  | x == y + 1 = solve (y:xs) 1
  | otherwise = solve (y:xs) 0
solve (x:xs) diff = True
