import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b

main = do
 getLine
 inputs <- readLnInt
 putStr $ solve inputs

solve s = (check$reverse s)?("Yes","No")

check (a:b)
 | null b = True
 | head b-a == 1 = True
 | a<head b = False
check s@(a:b:x)
 | b-a == 1 = check (a:x)
 | a<b = False
 | otherwise = check (b:x)