We consider the problem of unique identification of dielectric coefficients for gratings and sound speeds for wave guides from scattering data. We prove that the "propagating modes" given for all frequencies uniquely determine these coefficients. The gratings may contain conductors as well as dielectrics and the boundaries of the conductors are also determined by the propagating modes.