import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)
import Data.List

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

solve :: Int -> [Int] -> Bool
solve _ [] = True
solve c (h:hs)
  | h <= c = solve h hs
  | h > c && h - 1 <= c = solve (h - 1) hs
  | otherwise = False

main :: IO ()
main = do
  getLine
  as <- reverse <$> readIntsLine
  putStrLn $ if solve (10 ^ 10) as then "Yes" else "No"
