Scattering of 27.7 MeV deuterons on beryllium and boron