import Control.Monad

main :: IO ()
main = do
  _ <- getLine
  n <- map read . words <$> getLine
  putStrLn $ solve n

solve :: [Int] -> [Char]
solve n
  | length n == 1 = "Yes"
  | maximum n == minimum n == "Yes"
  | maximum n + 1 == minimum n == "Yes"
  | maximum n == minimum n + 1 == "Yes"
  | otherwise =
    if myCheck (head n) (head n) (tail n)
      then "Yes"
      else "No"

myCheck :: Int -> Int -> [Int] -> Bool
myCheck m h t -- max head tail
  | length t == 0 = True
  | otherwise =
    if m > head t + 1
      then False 
      else if m > h 
        then myCheck m (head t) (tail t)
        else myCheck h (head t) (tail t)