Yes it should work.
M.2 modules with two notches in B and M positions use up to two PCI Express lanes and provide broader compatibility at the same time, while the M.2 modules with only one notch in the M position use up to four PCI Express lanes; both examples may also provide SATA storage devices. Similar keying applies to M.2 modules that utilize provided USB 3.0 connectivity
P.S.
Just to make sure. M.2 SSD that you intend to buy is just smaller than 2.5" models - usually cost a bit more with no performance advantage.
Yes it should work.
M.2 modules with two notches in B and M positions use up to two PCI Express lanes and provide broader compatibility at the same time, while the M.2 modules with only one notch in the M position use up to four PCI Express lanes; both examples may also provide SATA storage devices. Similar keying applies to M.2 modules that utilize provided USB 3.0 connectivity
P.S.
Just to make sure. M.2 SSD that you intend to buy is just smaller than 2.5" models - usually cost a bit more with no performance advantage.