The present invention provides formula (I) compound (: or its stereoisomer, tautomer or pharmaceutically acceptable salt, wherein all variables are as defined herein. Compound is selectivity factor XIa inhibitor or the double inhibitor of FXIa and plasma kallikrein. Thromboembolic disorders and/or inflammatory conditions are treated the invention further relates to the pharmaceutical composition comprising compound and using it.