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

H.each_with_index do |h,i|
  if i == N - 1
    if h < H[i-1]
      puts "No"
      exit
    end
    break
  end

  if h > H[i+1]

    H[i] -= 1

    if H[i] > H[i+1] || H[i] < H[i-1]
      puts "No"
      exit
    end
  end
end

puts "Yes"
