Compounds of formulas (I), (II), (III) and (IV) and their pharmaceutically acceptable salts are disclosed. The compounds are ALK2 kinase inhibitors. Also described are pharmaceutical compositions containing compounds of formulas (I), (II), (III) or (IV) or their pharmaceutically acceptable salts, and methods involving the use of compounds or their pharmaceutically acceptable salts and compositions for the treatment and prevention of various diseases or pathological conditions such as progressive ossifying fibrodysplasia.Раскрыты соединения формул (I), (II), (III) и (IV) и их фармацевтически приемлемые соли. Соединения являются ингибиторами ALK2 киназы. Также описаны фармацевтические композиции, содержащие соединения формул (I), (II), (III) или (IV) или их фармацевтически приемлемые соли, и способы, включающие применение соединений или их фармацевтически приемлемых солей и композиций для лечения и предупреждения различных заболеваний или патологических состояний, таких как прогрессирующая оссифицирующая фибродисплазия.