let range = (0..<Int(readLine()!)!-1).reverse()
var H = readLine()!.characters.split(" ").map{Int(String($0))!}
for i in range {
    if H[i] > H[i+1] {
        H[i] -= 1
    }
}
var ans = "Yes"
for i in range {
    if H[i] > H[i+1] {
        ans = "No"
    }
}
print(ans)