The present invention provides a compound having an inhibitory action on amyloid β production, particularly a BACE1 inhibitory action, and is useful as a therapeutic or prophylactic agent for diseases induced by production, secretion and / or deposition of amyloid β protein. Formula (I): wherein X is -S- or -O-, R3a is alkyl, haloalkyl, etc., R2a is H, halogen, alkyloxy, haloalkyloxy, etc., R2b is H, etc. R3b is H or alkyl, Ring A and Ring B are each independently a substituted or unsubstituted aromatic carbocyclic ring, a substituted or unsubstituted aromatic heterocyclic ring, etc., and R1 is substituted or unsubstituted Or a pharmaceutically acceptable salt thereof.本発明は、アミロイドβ産生抑制作用、特にBACE1阻害作用を有し、アミロイドβタンパク質の産生、分泌および/または沈着により誘発される疾患の治療または予防剤として有用な化合物を提供する。 式(I):(式中、Xは-S-または-O-であり、R3aはアルキル、ハロアルキル等であり、R2aはH、ハロゲン、アルキルオキシ、ハロアルキルオキシ等であり、R2bはH等であり、R3bはHまたはアルキルであり、環Aおよび環Bは各々独立して置換若しくは非置換の芳香族炭素環、置換若しくは非置換の芳香族複素環等であり、かつR1は置換若しくは非置換のアルキル等である)で示される化合物またはその製薬上許容される塩。