The present invention relates to compounds able to inhibit the protein Gli1 having the formula
wherein the meanings of the substituents are indicated in the description, for use in the treatment of diseases related to Gli-1. The present invention also relates to compounds of formula (IIa) and (IIb) and to their use as medicaments, in particular for the treatment of diseases related to Gli1, more in particular for the treatment of tumors. Pharmaceutical compositions comprising said compounds of formula (IIa) or (IIb) are also within the scope of the present invention.