Gitin8: 7
הַכּוֹנֵס אֶת יְבִמְתּוֹ, וְהָלְכָה צָרָתָהּ וְנִשֵֹּׂאת לְאַחֵר, וְנִמְצֵאת זֹאת שֶׁהִיא אַיְלוֹנִית — תֵּצֵא מִזֶּה וּמִזֶּה, וְכָל הַדְּרָכִים הָאֵלּוּ בָּהּ.
[If] one married his yevamah, and her co-wife went and was married to another, and it was discovered that this one is an ailonis, she must leave both of them, and all of these procedures apply to her.