Resonant two photon ionization of H and D atoms