
foo :: [Int] -> Bool
foo [] = True
foo nums = fst $ foldl bar (True, head nums) $ tail nums

bar :: (Bool, Int) -> Int -> (Bool, Int)
bar (False, _) _ = (False, 0)
bar (True,  x) y
  | x > y = (False, 0)
  | x == y = (True, y)
  | otherwise = (True, y-1)

showFoo :: Bool -> String
showFoo True = "Yes"
showFoo _    = "No"

main = do
  _ <- getLine
  ints <- map read . words <$> getLine :: IO [Int]
  putStrLn $ showFoo $ foo ints

