let rec manipulate maxH lst =
    match lst with
    | [] -> true
    | [x] -> maxH - x <= 1
    | x :: tail when maxH - x > 1 -> false
    | x :: tail -> manipulate (max maxH x) tail

let _ = stdin.ReadLine() |> int
stdin.ReadLine().Split(' ')
|> Array.map int
|> Array.toList
|> manipulate 0
|> fun flag -> if flag then "Yes" else "No"
|> printfn "%s"
