No, the size of the array doesn't need to be a power-of-2 if you use modulus to derive indices. But you need to deal with the overflow somehow. For instance:
0xffffffff % 7 = 3, but (0xffffffff + 1) % 7 = 0.
0xffffffff % 7 = 3, but (0xffffffff + 1) % 7 = 0.