let n = int (stdin.ReadLine())
let h = stdin.ReadLine().Split() |> Array.map int64 |> Array.rev
match n with
| 1 -> printfn "Yes"
| _ -> 
     let l = [for i in 0..n - 2 -> if h.[i + 1] < h.[i] then h.[i] - 1L else h.[i]]
     (if l = List.sortDescending l then "Yes" else "No") |> printfn "%s"