Given that the m power of 2 multiplied by the m power of 4 multiplied by the m power of 8 = the 24 power of 2, find M

Given that the m power of 2 multiplied by the m power of 4 multiplied by the m power of 8 = the 24 power of 2, find M

2^M*4^m*8^M=2^24
2^M*2^2M*2^3M=2^24
2^(M+2M+3M)=2^24
6M=24
M=4