FIELD: pharmaceutics.SUBSTANCE: invention relates to N-heteroaryl compounds and pharmaceutically acceptable salts, solvates or N-oxides of general formula (I), where R1: halogen, C1-C6-alkyl, C1-C6-alkyloxy, C1-C6-alkylthio, C2-C6-alkenyl, C2-C6-alkynyl, C1-C6-alkoxy-C-1-C6-alkyl, C1-C6-alkyl-carbonyl, SF5, C1-C6-alkylsulphonyl, wherein each carbon-containing radical is optionally substituted with one or more halogen atoms, R2: hydrogen, C1-C6-alkyl, R3, R4 and R7 hydrogen, C1-C6-alkyl, R5: hydrogen, C1-C6-alkyl, C1-C6-acyl or C1-C6-alkyloxycarbonyl, R6: hydrogen, C1-C6-alkyl, C1-C6-alkyloxycarbonyl, phenyl, phenyl-C1-C6-alkyl, n=1-3, X: carbonyl, thiocarbonyl or sulphonyl group, A is a bond, E is a bond or NR9, where R9 - hydrogen, B is N, D is N or CR11, where R11 - hydrogen, Y1 is C or N, where C is substituted with R12, which is hydrogen, C1-C6-alkyl, C1-C6-galoalkilom, nitro, Y2 is C or N, where C is substituted with R13, which is hydrogen, halogen, C1-C6-alkyl, C1-C6-haloalkyl, C1-C6-alkoxy, C1-C6-haloalkoxy, nitrilo, di(C1-C6-alkyl)amino, N-pyrrolidinyl, C1-C6-alkylthio, C1-C6-alkylcarbonyl, aminocarbonyl, C1-C6-alkylamino-carbonyl, C1-C6-alkoxycarbonyl, Y3 is C, where C is substituted with R14, which is hydrogen, C1-C6-alkyl, C1-C6-alkoxy, amino, N-pyrrolidinyl, N-piperidinyl, N-morpholinyl, C1-C6-alkylcarbonyl, 1,3-dioxolane, which is unsubstituted or substituted with C1-C6-alkyl, Y4 is C or N, where C is substituted with R15, which is hydrogen, C1-C6-alkyl, wherein two of Y1, Y2 and Y4 can represent N, or Y3 and Y4 are bonded to form a ring system, selected from phenyl, thiophene, imidazole, pyridine, furan, 1,4-dioxane, triazole, and where at least one of B and D is a nitrogen atom. Invention also relates to a pharmaceutical composition based on compound of formula (I), intermediate compounds of formulae (1-IV), (3-IV), (4-II), method of treating helminth infection, compounds of formula (Ia), use of formula (I) and (Ia).EFFECT: obtaining novel compounds e