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.