M.2, SATA and SATAe ports maximum support 1x M.2_PCIe + 6x SATAs or 1x M.2_SATA + 1x M.2_PCIe + 4x SATAs. Please refer to page 34 for M.2 slots with examples of various combination possibilities.
https://cz.msi.com/Motherboard/Z170A-GAMING-M5/Specification
manuál: https://download.msi.com/archive/mnu_exe/E7977v1.0.zip