import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
public class Main {
public static void main(String[] args) {
Integer[] inputArray = new Integer[]{1, 3, 5, 7, 9};
Integer[] outputArray = new Integer[inputArray.length - 1];
AtomicInteger index = new AtomicInteger(0);
Arrays.stream(inputArray).reduce((a, b) -> {
outputArray[index.getAndIncrement()] = a * b;
return b;
});
System.out.println(Arrays.toString(outputArray));
}
}