The invention relates to a compound of formula I capable of inhibiting SHP2 activity, wherein P, Q, Y1, Y2, R1, R2A, r2b, R3a, R3b, R4A, r4b, r5a, r5b, R7 and R8 are defined in the content of the invention. The invention also provides methods for preparing compounds of the invention, pharmaceutical preparations containing such compounds, and methods for controlling diseases or disorders associated with abnormal SHP2 activity using such compounds and compositions.本發明涉及能夠抑制SHP2活性的式I化合物,其中p、q、Y1、Y2、R1、R2a、R2b、R3a、R3b、R4a、R4b、R5a、R5b、R7和R8如發明內容中所定義。發明還提供用於製備本發明化合物的方法、包含此類化合物的藥物製劑和使用此類化合物和組合物控制與異常SHP2活性相關的疾病或病症的方法。