YES.
However, other things can also cause it.
parts not seated properly
connectors jarred loose or not reconnected
if the OS was on the old M2, did you reinstall it?
Is the RAM the correct type?
Does the BIOS configuration match the RAM specs?
Start by checking your BIOS. If you can't get to it, remove everything and replace your old parts. If it works, change your RAM out. If it works change your M2.
Process of elimination troubleshooting.