object Main{
 
def main(args: Array[String]): Unit = {
  
    val arr1 = io.StdIn.readLine().split(' ')
    val n = arr1(0).toInt
    val arr2 = io.StdIn.readLine().split(' ')
    val h = arr2.map(_.toInt)

    var yes = true

    var base = -2
    h.indices.map{
      i =>
        if(i != n - 1){
        val res = h(i + 1) - h(i)
        
        if(res >= 0) {
          base = -2
        }else if(res <= base){
          yes = false
        }else{
          base = base - res
        }
        
        
    }
    }
  
    if(n == 1) {
      yes = true
    }
    
    
    if(yes) println("Yes") else println("No")
  
  
}
}