-- Build Stairs

upDownMap :: [Int] -> [Int]
upDownMap(x1:(x2:xs)) =  [x2 - x1] ++ upDownMap(x2:xs)
upDownMap(x1:[]) = [x1] ++ upDownMap([])
upDownMap([]) = []

main::IO()
main = do
  n <- words <$> getLine
  h <- words <$> getLine
  let heights = map(\n -> read n :: Int) h
  case length $ filter (< -1) $ upDownMap $ heights of
    0 -> print "Yes"
    _ -> print "No"