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 : [])
  | h0 - h1 <= 1 = "Yes"
  | otherwise = "No"
simulate (h0 : h1 : h2 : [])
  | h1 > h0 && h1 - h2 <= 1 = "Yes"
  | otherwise = "No"
simulate (h0 : h1 : h2 : h3 : hs)
  | h1 > h0 && h1 - h2 == 1 && h3 >= h2 = simulate (h3 : hs)
  | h1 >= h0 && h2 >= h1 = simulate (h1 : h2 : h3 : hs)
  | otherwise = "No"

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