The present invention provides a compound having an ACC inhibitory action, which is useful as an agent for the prophylaxis or treatment of obesity, diabetes and the like, and having superior efficacy. The present invention relates to a compound represented by the formula (I): wherein each symbol is as defined in the specification, or a salt thereof.ACC阻害作用を有し、肥満症、糖尿病等の予防・治療に有用であり、かつ優れた薬効を有する化合物を提供する。本発明は、式(I):[式中、各記号は明細書記載のとおり]で表される化合物またはその塩である。