The present invention relates to pyrazole and imidazole derivatives of formula (I) wherein U, V, L, X, Y, R1, (R2)n and (R3)m and ring A are as described in the description, to their preparation, to pharmaceutically acceptable salts thereof, and to their use as pharmaceuticals, to pharmaceutical compositions containing one or more compounds of formula (I), and especially to their use as orexin receptor antagonists.