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

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words

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

simulate :: [Int] -> String
simulate [h] = "Yes"
simulate (h0 : h1 : [])
  | h1 - h0 > 0 = "Yes"
  | otherwise = "No"
simulate (h0 : h1 : h2 : hs)
  | h1 >= h0 && (h1 - h2 == 1 || h2 > h1) = simulate (h2 : hs)
  | h0 - h1 == 1 = simulate (h1 : h2 : hs)
  | otherwise = "No"

main = do
  n <- getInt
  hs <- getIntList
  putStrLn $ simulate hs
