Wave spectra of two-dimensional Yukawa solids and liquids in the presence of a magnetic field