The present invention provides compounds of the general formula (I), their salts and N-oxides, and solvates and prodrugs thereof (wherein the characters are as defined in the description). The compounds of the general formula (I) are inhibitors of Factor XIa, so that they are useful in the prevention of and/or therapy for thromboembolic diseases.本發明提供一種通式(I)化合物、其鹽類與N-氧化物、及其溶劑合物與前藥(其中各代號係如本說明書中之定義)。通式(I)化合物為因子XIa之抑制劑,因此其適用於預防及/或治療血栓性栓塞疾病。