Heterocyclic compounds containing 1,2-thiazole or hydrogenated 1,2-thiazole rings