main :: IO ()
main = do
  input1 <- getLine
  input2 <- getLine
  let n = readInt input1
      hs = take n . map readInt $ words input2
  putStrLn . show $ if executeC hs then "Yes" else "No"

executeC :: [Int] -> Bool
executeC [h0, h1] = h0 <= h1
executeC (h0:h1:hs)
  | h0 <= h1 = executeC (h1:hs)
  | h0 <= h1 - 1 = executeC ((h1 - 1):hs)
  | otherwise = False

readInt :: String -> Int
readInt = read