The present invention relates to compounds of the formula wherein hetaryl I is a five- or six-membered heteroaryl group containing 1-3 heteroatoms selected from S or N; hetaryl II is a six-membered heteroaryl group containing 1-3 heteroatoms selected from S or N, or is a two-ring system containing 1-4 heteroatoms selected from S or N, where at least one ring is aromatic; R <;5>; is lower alkyl, lower alkoxy, lower alkyl substituted with halogen, or halogen; R 1 represents lower alkyl, lower alkyl substituted by halogen, hydrogen, lower alkoxy, cycloalkyl substituted by lower alkyl, or lower alkyl substituted by halogen, or represents lower alkyl, substituted by hydroxy, or represents furyl, or represents O-benzyl, - (CH) -phenyl, possibly substituted with halogen, lower alkoxy, lower alkyl, substituted with halogen, lower alkyl or cyano; R 1 is hydrogen or lower alkyl; Y represents- (CH) -, -CHOC-, -CHO-, CHS-, -CHSCH- and is attached to two ring carbon atoms, the bond is through each ring carbon atom a and b or through each ring atom c and d; p represents 0 or 1; m represents 0, 1 or 2; if m is 2, then R may be the same or different; n represents 2 or 3; o represents 0, 1 or 2, if o represents 2, then R may be the same or different; or their pharmaceutically active acid addition salts. The present compounds of formula I are modulators of amyloid beta and, thus, they can be useful for the treatment or prevention of diseases associated with deposition.Настоящее изобретение относится к соединениям формулыгде гетарил I представляет собой пяти- или шестичленную гетероарильную группу, содержащую 1-3 гетероатома, выбранных из S или N; гетарил II представляет собой шестичленную гетероарильную группу, содержащую 1-3 гетероатома, выбранных из S или N, или представляет собой двухкольцевую систему, содержащую 1-4 гетероатома, выбранных из S или N, где по меньшей мере одно кольцо является ароматическим; R1 представляет собой низший алкил, низший алкокси, низший алкил, замещ