n = gets.to_i
h = gets.split().map(&:to_i)
i = 0
n -= 1
ans = "Yes"
n.times do
  if h[i] > h[i+1]
    h[i] -= 1
    if h[i] > h[i+1] || h[i] < h[i-1]
      ans = "No"
      break
    end
  end
  i += 1
end
puts ans