-- Build Stairs
import Data.List
 
data YesNo = Yes | No deriving Show
 
upDownMap :: [Int] -> Bool
upDownMap (x1:(x2:xs))
  | x1 - x2 >= 0 = True && upDownMap(x2:xs)
  | x1 - x2 >= -1 = True && upDownMap((min x1 x2):xs)
  | x1 - x2 < -1  = False
upDownMap(x1:[]) = True 
upDownMap([]) = True
 
main::IO()
main = do
  n <- words <$> getLine
  h <- words <$> getLine
  let heights = map(\e -> read e :: Int) h
  case upDownMap $ reverse $ heights of
    True -> print Yes
    False -> print No