A compound of formula (Ia), or the pharmaceutically acceptable salt thereof, wherein, R 1 and R 2 are selected from hydrogen and halogen; R 3 is selected from the group consisting of hydrogen, halogen, -OH, -CN, -NO 2, -NH 2, -C 1-10 alkyl,-C 3-10 cycloalkyl, -O-C 1-8 alkyl, -O-C 1-8 alkyl (alkoxy), -O- C 3-8 cycloalkyl (cyclalkoxy), -S-C 1-8 alkyl (thioalkoxy), -C -C 1-8 alkyl, -COOH, -C NH 2, -C NH-C 1-8 alkyl, -C N(C 1-8 alkyl) 2,-C O-C 1-8 alkyl, -C 1-8 haloalkyl (haloalkoxy), -C 3-8 alkenyl, -C 3-8 alkynyl, -OC -NH 2, -OC -NH(C 1-8 alkyl), -OC -N(C 1-8 alkyl) 2, -NH(C 1-8 alkyl), -N(C 1-8 alkyl) 2, -NH-SO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-SO 2 -C 1-8 alkyl, -NH-C -(C 1-8 alkyl), -N(C 1-8 alkyl)-C -(C 1-8 alkyl), -NH-C O-C 1-8 alkyl, -N(C 1-8 alkyl)-C O-C 1-8 alkyl, -NH-C -NH 2, -NH-C -NH(C 1-8 alkyl), -N(C 1-8 alkyl)-C -NH(C 1-8 alkyl), -N(C 1-8 alkyl)-C -N(C 1-8 alkyl) 2, -NH-C -NH-SO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-C -NHSO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-C -N(C 1-8 alkyl)-SO 2 -C 1-8 alkyl, -S-C 1-8 alkyl, -S -C 1-8 alkyl, -SO 2 -C 1-8 alkyl, -S-aryl, -S -aryl, SO 2 -aryl, -SO 2 NH 2, -SO 2 NH-(C 1-8 alkyl), -SO 2 N(C 1-8 alkyl) 2; W is -CH=; X is -CH=CH-; Y is -CH=CH-; Z is a bond; A is -OR; P is selected from the group consisting of -O-, -S-- and -NR-; Q is a group selected from hydrogen, OR, -COOR, -CONRR', -CONHSO 2 R, -NHCO(CRR')-COOR, -C(R,R')OH or -OCH 2 C(R,R')OH; R and R' are independently selected from the group consisting of hydrogen, -C 1-6 alkyl, -C 3-6 cycloalkyl, -C 1-3 alkyl (cycloalkyl), -C 3-6 alkenyl and -C 3-6 alkynyl or, R and R' along with the atom to which they are attached, together can form a substituted or unsubstituted 5 to 8 membered cyclic ring; 'm' is an integer selected from 0 to 4, both inclusive. R 1 and R 2 are selected from hydrogen and halogen; R 3 is selected from the group consisting of hydrogen, halogen, -OH, -CN, -NO 2, -NH 2, -C 1-10 alkyl,-C 3-10 cycloalkyl, -O-C 1-8 alkyl, -O-C 1-8 alkyl (alkoxy), -O- C 3-8 cycloalkyl (cyclalkoxy), -S-C 1-8 alkyl (thioalkoxy), -C -C 1-8 alkyl, -COOH, -C NH 2, -C NH-C 1-8 alkyl, -C N(C 1-8 alkyl) 2,-C O-C 1-8 alkyl, -C 1-8 haloalkyl (haloalkoxy), -C 3-8 alkenyl, -C 3-8 alkynyl, -OC -NH 2, -OC -NH(C 1-8 alkyl), -OC -N(C 1-8 alkyl) 2, -NH(C 1-8 alkyl), -N(C 1-8 alkyl) 2, -NH-SO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-SO 2 -C 1-8 alkyl, -NH-C -(C 1-8 alkyl), -N(C 1-8 alkyl)-C -(C 1-8 alkyl), -NH-C O-C 1-8 alkyl, -N(C 1-8 alkyl)-C O-C 1-8 alkyl, -NH-C -NH 2, -NH-C -NH(C 1-8 alkyl), -N(C 1-8 alkyl)-C -NH(C 1-8 alkyl), -N(C 1-8 alkyl)-C -N(C 1-8 alkyl) 2, -NH-C -NH-SO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-C -NHSO 2 -C 1-8 alkyl, -N(C 1-8 alkyl)-C -N(C 1-8 alkyl)-SO 2 -C 1-8 alkyl, -S-C 1-8 alkyl, -S -C 1-8 alkyl, -SO 2 -C 1-8 alkyl, -S-aryl, -S -aryl, SO 2 -aryl, -SO 2 NH 2, -SO 2 NH-(C 1-8 alkyl), -SO 2 N(C 1-8 alkyl) 2; W is -CH=; X is -CH=CH-; Y is -CH=CH-; Z is a bond; A is -OR; P is selected from the group consisting of -O-, -S-- and -NR-; Q is a group selected from hydrogen, OR, -COOR, -CONRR', -CONHSO 2 R, -NHCO(CRR')-COOR, -C(R,R')OH or -OCH 2 C(R,R')OH; R and R' are independently selected from the group consisting of hydrogen, -C 1-6 alkyl, -C 3-6 cycloalkyl, -C 1-3 alkyl (cycloalkyl), -C 3-6 alkenyl and -C 3-6 alkynyl or, R and R' along with the atom to which they are attached, together can form a substituted or unsubstituted 5 to 8 membered cyclic ring; 'm' is an integer selected from 0 to 4, both inclusive.