The invention relates to compounds of formula (I). Hetaryl I is a five or six membered heteroaryl group, containing 1 to 3 heteroatoms, selected from O, S or N hetaryl II is a five or six membered heteroaryl group, containing 1 to 3 heteroatoms, selected from O, S or N, or is a two membered ring system containing 1 to 4 heteroatoms selected from S, O or N, wherein at least one ring is aromatic in nature R1 is lower alkyl, lower alkoxy, lower alkyl substituted by halogen, or halogen R2 is halogen, lower alkyl, lower alkoxy, hydroxy, lower alkyl substituted by halogen, lower alkyl substituted by hydroxy or benzo[1,3]dioxolyl, or is -(CHR)p-phenyl, optionally substituted by halogen, lower alkyl, lower alkoxy, S(O)2-lower alkyl, cyano, nitro, lower alkoxy substituted by halogen, dimethylamino, -(CH2)P-NHC(O)O-Iower alkyl, or lower alkyl substituted by halogen, and R is hydrogen, halogen, hydroxy or lower alkoxy, or is cycloalkenyl or cycloalkyl, optionally substituted by hydroxy or lower alkyl substituted by halogen, or is a five or six membered heteroaryl group, containing 1 to 3 heteroatoms, selected from O, S or N, which is optionally substituted by halogen, lower alkyl, lower alkoxy or dimethylamino, or is O-phenyl, optionally substituted by halogen, or is heterocycloalkyl, optionally substituted by halogen, hydroxy, lower alkyl substituted by halogen or C(O)O-lower alkyl R3 is hydrogen, lower alkyl, cyano or phenyl R4 is lower alkoxy, lower alkyl or halogen p is 0 or 1 n is 0, 1 or 2 if n is 2 then R4 may be the same or different m is 0, 1 or 2 if m is 2 then R1 may be the same or different o is 0, 1, 2 or 3, if o is 2 or 3 then R2 may be the same or different or to pharmaceutically active acid addition salts thereof. The compounds of formula (I) are modulators for amyloid beta and thus, they may be useful for the treatment or prevention of a disease associated with the deposition of β-amyloid in the brain, in particular Alzheimers disease, and other diseases such