The present invention provides a compound having a superior Smo inhibitory activity and lower toxicity, which is sufficiently satisfactory as a pharmaceutical product. The present invention provides a compound represented by the formula wherein ring A is 5- to 7-membered ring optionally having substituent(s), where substituents are optionally bonded to each other to form a ring; X is O, S or NR1 (R1 is a hydrogen atom or a hydrocarbon group optionally having substituent(s)); R2 is carbamoyl optionally having substituent(s); and R3 is hydroxy optionally having substituent(s), or a salt thereof.