-- Build Stairs
import Data.List

data YesNo = Yes | No deriving Show

upDownMap :: [Int] -> [Int]
upDownMap(x1:(x2:xs)) =  [x2 - x1] ++ upDownMap(x2:xs)
upDownMap(x1:[]) = [x1] ++ upDownMap([])
upDownMap([]) = []

judge :: [Int] -> YesNo
judge a
  | (length $ filter(< -1) $ upDownMap $ a) > 0 = No
  | (length $ filter(\l -> ((length l) > 1)) $ filter(\l -> -1 `elem` l) $ group $ upDownMap $ a) > 0 = No
  | otherwise = Yes

main::IO()
main = do
  n <- words <$> getLine
  h <- words <$> getLine
  let heights = map(\e -> read e :: Int) h
  print $ judge $ heights