Configuration of secondary amides and thioamides: spectroscopic and theoretical studies