the invention provides novel substituted heterocyclic compounds represented by formula i and formula ii , or a pharmaceutically acceptable salt , solvate , polymorph , ester , tautomer or prodrug thereof , and a composition comprising these compounds . the compounds provided can be used as inhibitors of mek and are useful in the treatment of inflammatory diseases , cancer and other hyperproliferative diseases . the invention further provides a method of treatment for inflammatory diseases , cancer and other hyperproliferative diseases in mammals , especially humans .