The question is wrong in the sense that data lines do not specify the number of memory locations, but just the number of bits that can be transferred once a specific address is located. That means $1M\times 8bit$ has same capacity as $512K\times 16bits$ (8Mbits or 1MByte).
So asking number of “memory locations” in this question means asking number of locations possible with 7 bit address with each location of size 8 bits; plus 4 such possible configuration (2 chip select bits $\rightarrow\ 2^2=4$).
Therefore the true answer should be $2^7\times 2^2=2^9$ number of memory addresses.
If however, the question was to give the size of the possible chip configuration, then we have to multiply $2^9$ with 8, which is $2^{12}$ bits or 4Kbits or 512 Bytes.