The present invention provides a compound of Formula I and pharmaceutical compositions comprising one or more said compounds, and methods for using said compounds for treating or preventing thromboses, embolisms, hypercoagulability or fibrotic changes. The compounds are selective Factor XIa inhibitors or dual inhibitors of Factor XIa and plasma kallikrein.本發明提供式I化合物, 及包含一或多種該等化合物之醫藥組合物,及使用該等化合物治療或預防血栓形成、栓塞、高凝血性或纖維病變之方法。該等化合物係選擇性因子XIa抑制劑或因子XIa及血漿激肽釋放素之雙重抑制劑。