A method for treating cancer with a mutation in ROS or RET, comprising identifying a subject with a cancer with a mutation in ROS or RET, and administering to the subject an effective amount of a compound according to formulae (I) OR (la) or a tautomer, or a pharmaceutically acceptable salt thereof, wherein the variables structural formulae are defined herein.