Measurement of the Isotopic Composition of Cosmic-Ray Helium, Lithium, Beryllium, and Boron up to 1700 MeV per Atomic Mass Unit