{-# LANGUAGE BangPatterns #-}
import Control.Arrow
import Control.Monad.Fix
import Data.Char
import Data.Int
import Data.Foldable
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Debug.Trace

solve :: Int -> VU.Vector Int -> Bool
solve !n !hn = go $ VU.toList hn
 where
  go (x:y:xs) | x == y    = go $ y : xs
              | x < y     = go $ (y - 1) : xs
              | otherwise = False
  go _ = True

main = do
  let readInt :: Integral a => B.ByteString -> Maybe (a, B.ByteString)
      readInt = fmap (first fromIntegral . second B.tail) . B.readInt

  n  <- (\vec -> (vec VU.! 0)) . VU.unfoldrN 1 readInt <$> B.getLine
  hn <- VU.unfoldrN n readInt <$> B.getLine
  putStrLn $ if solve n hn then "Yes" else "No"
