The invention provides compounds of Formulas Ia-Ib, stereoisomers or pharmaceutically acceptable salts thereof, wherein A, X, Ra, R1, R2, R4, R5 and R16 are defined herein, a pharmaceutical composition that includes a compound of Formulas Ia-Ib and a pharmaceutically acceptable carrier, adjuvant or vehicle, and methods of using the compound or composition in therapy.本発明は、(式Ia~Ib)(式中、A、X、Ra、R1、R2、R4、R5及びR16は、本明細書に定義される)その立体異性体又はその薬学的に許容しうる塩のTYK2阻害剤、式(Ia~Ib)の化合物及び薬学的に許容しうる担体、補助剤又はビヒクルを含む医薬組成物、並びに炎症性疾患の治療における該化合物又は組成物の使用方法を提供する。