וַיִּמָּֽסְרוּ֙ מֵאַלְפֵ֣י יִשְׂרָאֵ֔ל אֶ֖לֶף לַמַּטֶּ֑ה שְׁנֵים־עָשָׂ֥ר אֶ֖לֶף חֲלוּצֵ֥י צָבָֽא׃
So there were delivered, out of the thousands of Israel, a thousand of every tribe, twelve thousand armed for war.
Shabbat Siddur Sefard Linear
Your teeth are like a counted flock which have come up from the washing; all of which are perfect and none are blemished among them.46This is said in reference to the 12,000 men who fought against Midian [Numbers 31:5]; not one of them was ‘blemished’ even with suspicion of lewdness. So chaste were they that they brought offerings of atonement even for evil thoughts they might have had.— Rashi