Compounds of formula wherein A 1 and A 2 are independently selected from the group consisting of CH and N, provided that A 1 and A 2 are not N simultaneously; R 1 is C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, C 1 -C 7 -alkyl-C -, cyano, halogen, amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, cycloalkyl, or heterocyclyl; R 2 and R 3 are independently hydrogen or C 1 -C 7 -alkyl; R 4 is heteroaryl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl; Y is 5-membered heteroaryl selected from the group consisting of: wherein said heteroaryl is optionally substituted by one substituent selected from the group consisting of C 1 -C 7 -alkyl, which is optionally substituted by 1 to 3 substituents selected from the group consisting of aryl, cycloalkyl, heterocyclyl, C 1 -C 7 -alkoxy, hydroxyl, halogen, amino optionally substituted by one or two C 1 -C 7 -alkyl, COOH, COO-C 1 -C 7 -alkyl, oxo, cyano and heteroaryl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, cycloalkyl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, and heterocyclyl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl; and R 5 is phenyl or 6- or 10-membered heteroaryl containing one or two nitrogen, wherein said phenyl and said heteroaryl are optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 alkoxy C 1 -C 7 -alkyl, or pharmaceutically acceptable salts thereof. A 1 and A 2 are independently selected from the group consisting of CH and N, provided that A 1 and A 2 are not N simultaneously; R 1 is C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, C 1 -C 7 -alkyl-C -, cyano, halogen, amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, cycloalkyl, or heterocyclyl; R 2 and R 3 are independently hydrogen or C 1 -C 7 -alkyl; R 4 is heteroaryl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl; Y is 5-membered heteroaryl selected from the group consisting of: wherein said heteroaryl is optionally substituted by one substituent selected from the group consisting of C 1 -C 7 -alkyl, which is optionally substituted by 1 to 3 substituents selected from the group consisting of aryl, cycloalkyl, heterocyclyl, C 1 -C 7 -alkoxy, hydroxyl, halogen, amino optionally substituted by one or two C 1 -C 7 -alkyl, COOH, COO-C 1 -C 7 -alkyl, oxo, cyano and heteroaryl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, cycloalkyl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, and heterocyclyl optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 -alkoxy C 1 -C 7 -alkyl; and R 5 is phenyl or 6- or 10-membered heteroaryl containing one or two nitrogen, wherein said phenyl and said heteroaryl are optionally substituted by 1 to 3 substituents selected from the group consisting of hydroxyl, halogen, C 1 -C 7 -alkyl, C 1 -C 7 -alkoxy, C 1 -C 7 -hydroxyalkyl, C 1 -C 7 -haloalkyl, C 1 -C 7 -alkoxy C 1 -C 7 -alkyl, acetyl, cyano and amino optionally substituted by 1 or 2 C 1 -C 7 -alkyl or C 1 -C 7 alkoxy C 1 -C 7 -alkyl,