main = do 
    _ <- getLine
    arr <- map (read :: String -> Int). words <$> getLine
    putStrLn $ if (solve 0 arr) then "Yes" else "No"
    where
        solve p [] = True
        solve p (x:xs) = 
            if x + 1 < p
            then
                False
            else
                if x < p
                    then
                        solve (x + 1) xs
                    else
                        solve x xs
