We demonstrate detection of femtogram-scale quantities of the explosive molecule 1,3,5-trinitroperhydro-1,3,5-triazine (RDX) via combined nanomechanical photothermal spectroscopy and mass desorption. Photothermal spectroscopy provides a spectroscopic fingerprint of the molecule, which is unavailable using mass adsorption/desorption alone. Our measurement, based on thermomechanical measurement of silicon nitride nanostrings, represents the highest mass resolution ever demonstrated via nanomechanical photothermal spectroscopy. This detection scheme is quick, label-free, and is compatible with parallelized molecular analysis of multicomponent targets.