-- ABC 136 C
import Data.Maybe
import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as VU

main :: IO()
main = do
  n <- getInt
  hs <- getIntList
  if solve hs
    then putStrLn "Yes"
    else putStrLn "No"

solve :: [Int] -> Bool
solve (h:hs) = solve' h hs
  where
    solve' n [] = True
    solve' n (m:ms)
      | n <= m = solve' m ms
      | n - m == 1 = solve' n ms
      | otherwise = False


-- ByteStringを用いた入力
readInt = fst . fromJust . BS.readInt

-- 整数を一つ受け取る
getInt = readInt <$> BS.getLine

-- 長さnの整数列を受け取る
getIntVec n = VU.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

-- 空白区切りの整数列をListで受け取る
getIntList = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine