-- C Build Stairs

import Data.List

main:: IO()
main = do
  l <- getLine
  let n = read l :: Int
  l2 <- getLine
  let a = take n (map read (words l2) :: [Int])
  let ans = solve a
  case ans of
    True -> putStr ("Yes\n")
    False -> putStr ("No\n")

solve:: [Int] -> Bool
solve (x1:x2:xs)
  | (x1 - x2 >= 1) = False
  | (x1 - x2 == 0) = solve (x2:xs)
  | otherwise = solve ((x2 - 1):xs)
solve x = True
