judge :: Bool -> (String,String) -> String
judge f (ts,fs) = case f of
  True -> ts
  False -> fs

func :: Int -> [Int] -> Bool
func _ [] = True
func n (x:xs)
  | n > x = False
  | n < x = func (x-1) xs
  | otherwise = func x xs

main = do
  _ <- getLine
  line <- getLine
  let
    vals = map read $ words line :: [Int]
    ret = func (vals!!0) vals
  putStrLn $ judge ret ("Yes","No")
