Observation of charmed mesons in photon-photon collisions