Inverse scattering of electromagnetic waves by multilayered structures: Uniqueness in TM mode