len = gets.to_i
height_list = gets.split(' ').map(&:to_i)

result = height_list.inject(1){|lim, h|
  if h >= lim
    if h > lim
      h-1
    else
      lim
    end
  else
    break
  end
}

puts(result ? 'Yes' : 'No')