import Control.Monad

main :: IO ()
main = do
  _ <- getLine
  n <- map read . words <$> getLine
  putStrLn $ solve n

solve :: [Int] -> [Char]
solve n
  | length n == 1 = "Yes"
  | otherwise =
    if myCheck (head n) (tail n)
      then "Yes"
      else "No"

myCheck :: Int -> [Int] -> Bool
myCheck m t -- max tail
  | length t == 0 = True
  | otherwise =
    if m > head t + 1
      then False 
      else if m > head t
        then myCheck m (tail t)
        else myCheck (head t) (tail t)