Implement validate_indices(indices, length) in the indexing module. Treat -1 as a sentinel and validate that non--1 indices are in range [0, length) when length>0 (and that all entries are -1 when length==0); raise ValueError for any negative value other than -1 and raise IndexError for out-of-bounds indices. Do not mutate the input and support lists or numpy arrays.