object Main extends App {
  def isNoDown(hs: List[Int]): String = {
    @annotation.tailrec
    def f(l: List[Int], before: Int): String = {
      l match {
        case h :: t =>
          if (before < 0 && h < 0) "No"
          else f(t, h)
        case _ => "Yes"
      }
    }

    val zip = hs.zip(hs.tail)
    f(zip.map(t => t._2 - t._1), 0)
  }
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  val hs = List.fill(n)(sc.nextInt)

  println(isNoDown(hs))
}