N = gets.to_i - 1
H = gets.split(" ").map(&:to_i)

i = 0
prev = -1
no = false

while i < N do
  tmp = H[i] - H[i + 1]
  if tmp == 0
    if prev <= -1
      H[i] = H[i] - 1
      tmp = prev - 1
    end
  elsif tmp < 0
  elsif tmp == 1 && prev < 0 
    H[i] = H[i] - 1
    tmp = 0
  else
    no = true
    break
  end
  prev = tmp
  i = i + 1
end

puts no ? "No" : "Yes"
