Add a given value before the first not prime element. If all values in the array are simple, then the given value is added at the end.