let n=Int(readLine()!)!
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var i = 0
var p = arr[0]
var ret : String = ""
for i in 1..<n {
  let d = arr[i] - arr[i - 1]
  if(  d < -1 ) {
    break
  } else if( d < 0 ) {
    arr[i - 1] -= 1
  }
}

for i in 1..<n {
  if( arr[i] < arr[i - 1] ) {
    ret = "No"
    break
  }
}

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