Methods of treating cancer with a compound of formulae (I) or (Ia) are disclosed. Also provided are methods of treating a cancer with a mutation in ALK or a c-MET mutation with a compound of formulae (I) or (Ia). Further provided are methods of treating non-small cell lung cancer with a mutation in ALK with a compound of formulae (I) or (Ia):a tautomer, or a pharmaceutically acceptable salt thereof, wherein the variables in the structural formulae are defined herein.