n=gets.chomp.to_i
h = gets.split(" ").map(&:to_i)
result = true
i = 0
while(i < n - 1) do 

  if h[i + 1] < h[i] - 1
        puts h[i]
    puts h[i+1]
    result = false
    break
  end
  if h[i + 1] > h[i]
    h[i + 1] -= 1
  end
  i+=1
end

a = result == true ? "Yes" : "No"
puts a