The accumulate_head_tail command replaces the first terms of a list by their sum and the last terms of a list by their sum.