Reduce with associative operation