Study of the spectra of fast deuterons produced in the interaction of 670 MeV protons with nuclei