can you please help me to identify this smd component marked M 412 727a?
It's an AQY412S "PhotoMOS' solid state relay, manufactured by Panasonic (formerly known as Matsushita Electric Industrial Co).

Datasheet says, 


  Note: For space reasons, the three initial letters of the part number
  “AQY”, the surface mount terminal shape indicator “S” and the packing
  style indicator “X” or “Z” are not marked on the device. (Ex. the
  label for product number AQY412SX is 412)


Product photo from here