check [] = True
check (h0:h) = snd $ foldl step (h0, True) h
    where step (k, a) x = (if k < x then x-1 else k, a && k <= x)

main = do
  n <- readLn :: IO Int
  h <- map read . words <$> getLine :: IO [Integer]
  putStrLn $ if check h then "Yes" else "No"
