kr :: [Int] -> [Int]
kr [x] = [x]
kr (x:x':xs) = if x < x' then x:kr ((x'-1):xs) else x:kr(x':xs)

masu :: [Int] -> String
masu [x] = "Yes"
masu (x:x':xs) = if x < x' then "No" else masu (x':xs)

main = do
    _ <- getLine
    h <- map read . words <$> getLine :: IO [Int]
    putStrLn $ masu . kr $ reverse h
