import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.List
import           Data.Maybe

readInts :: IO [Int]
readInts = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

main = do
  n <- BS.readInt <$> BS.getLine
  nums <- readInts
  putStrLn $ ans nums

ans :: [Int] -> String
ans nums
  | solve nums == -1 = "No"
  | otherwise = "Yes"

solve :: [Int] -> Int
solve = foldr f 1000000001
  where
    f :: Int -> Int -> Int
    f x acc
      | acc >= x = x
      | acc >= x - 1 = x - 1
      | otherwise = -1
