Compounds containing isocyanate or isothiocyanate groups