The present invention provides compounds of Formula (I): or stereoisomers, pharmaceutically acceptable salts thereof, wherein all of the variables are as defined herein. These compounds are inhibitors of factor XIa and/or plasma kallikrein which may be used as medicaments.