n = gets.to_i
h = gets.split.map(&:to_i)
if n == 1
  puts "Yes"
elsif n == 2
  puts (h[1] - h[0] >= -1) ? "Yes" : "No"
else
  possible = true
  operatable = true
  for i in 1...n do
    diff = h[i] - h[i - 1]
    case diff
    when -1
      if !operatable
        possible = false
        break
      else
        operatable = false
      end
    when -1000000000..-2
      possible = false
      break
    when 1..1000000000
      operatable = true
    end
  end
  puts possible ? "Yes" : "No"
end
