The present invention provides a compound of formula (I): wherein X, Y, Z1, Z2, R1, R2, A, B, p and q are as disclosed in the specification. A pharmaceutical composition and a method for modulating the Hedgehog pathway are also provided. The present invention further provides a process for preparing the compound.本發明提供一種式(I)之化合物: 其中X、Y、Z1、Z2、R1、R2、A、B、p及q如說明書中所揭示。亦提供一種用於調節刺蝟途徑之醫藥組合物及方法。本發明另提供一種用於製備該化合物之方法。