import CoreFoundation

let n=Int(readLine()!)!
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
 
var i = 0
var p = arr[0]
var ret : String = ""

if( i == 1 ) {
  print( "Yes" )
  exit(0)
}

for i in 0..<n - 1 {
  let d = arr[i] - arr[i + 1]
  //print( d )
  if(  d > 0 ) {
    ret = "No"
    break
  } else if( d < 0 ) {
    arr[i + 1] -= 1
  } 
}

//print( arr )

if( ret == "" ) {
  print( "Yes" )
} else {
  print( "No" )
}
  
