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 prophylactic 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, R1 is substituted or unsubstituted alkyl or the like, R5 is halogen or substituted or unsubstituted alkyl, and n is an integer of 0 to 2, or a pharmaceutically acceptable salt thereof.本發明提供一種化合物,其具有抑制澱粉狀蛋白β產生之效果,尤其為抑制BACE1之效果,且其適用作由澱粉狀蛋白β蛋白之產生、分泌及/或沈積所誘發之疾病的治療劑或預防劑。一種式(I)之化合物:其中X為-S-或-O-,R3a為烷基、鹵烷基或其類似基團,R2a為H、鹵素、烷氧基、鹵烷氧基或其類似基團,R2b為H或其類似基團,R3b為H或烷基,環A及環B各自獨立地為經取代或未經取代之芳族碳環、經取代或未經取代之芳族雜環或其類似基團,R1為經取代或未經取代之烷基或其類似基團,R5為鹵素或經取代或未經取代之烷基,且n為0至2之整數,或其醫藥學上可接受之鹽。