Public Class Program
  Shared Sub Main()
    Dim n As Long = Long.Parse(Console.ReadLine())
    Dim arrayH As Long() = Array.ConvertAll(Of String, Long)(Console.ReadLine().Split(" "), AddressOf Long.Parse)
    Dim output As String = "Yes"
    For i As Long = n - 1 To 1 Step -1
      Select Case arrayH(i - 1) - arrayH(i)
        Case 1
          arrayH(i - 1) -= 1
        Case > 1
          output = "No"
          Exit For
      End Select
    Next
    Console.WriteLine(output)
  End Sub
End Class