A composition having BACE 1 inhibitory activity containing a compound represented by the formula (I):wherein ring A is an optionally substituted heterocyclic groupE is lower alkyleneX is SR1 is a hydrogen atom or lower alkylR2a, R2b, R3a, R3b, R4a and R4b is each independently a hydrogen atom, halogen, or hydroxy etc.n and m are each independently an integer of 0 to 3n+m is an integer of 0 to 3R5 is a hydrogen atom or substituted lower alkylor its pharmaceutically acceptable salt thereof.