The present invention provides a compound which has an effect of inhibiting amyloid β production, especially an effect of inhibiting BACE1, and which is useful as a therapeutic or phylactic agent for diseases induced by production, secretion and/or deposition of amyloid β proteins. A compound of the formula (I) wherein X is -S- or -O-, R3a is alkyl, haloalkyl or the like, R2a is H, halogen, alkyloxy, haloalkyloxy or the like, R2b is H or the like, R3b is H or alkyl, ring A and ring B is each independently a substituted or unsubstituted aromatic carbocycle, a substituted or unsubstituted aromatic heterocycle or the like, and R1 is substituted or unsubstituted alkyl or the like, or a pharmaceutically acceptable salt thereof.