Yevamos2: 2
שְׁנֵי אַחִים וּמֵת אַחַד מֵהֶן, וְיִבֵּם הַשֵּׁנִי אֶת אֵשֶׁת אָחִיו, וְאַחַר כָּךְ נוֹלַד לָהֶן אָח, וָמֵת — הָרִאשׁוֹנָה יוֹצֵאת מִשּׁוּם אֵשֶׁת אָחִיו שֶׁלֹּא הָיָה בְעוֹלָמוֹ, וְהַשְּׁנִיָּה מִשּׁוּם צָרָתָהּ.  עָשָׂה בָהּ מַאֲמָר, וָמֵת — הַשְּׁנִיָּה חוֹלֶצֶת וְלֹא מִתְיַבֶּמֶת. רַבִּי שִׁמְעוֹן אוֹמֵר: מְיַבֵּם לְאֵיזוֹ מֵהֶן שֶׁיִּרְצֶה, אוֹ חוֹלֵץ לְאֵיזוֹ מֵהֶן שֶׁיִּרְצֶה.
[If there were] two brothers, and one of them died, and the second [then] performed yibum with his brother's widow; subsequently, another brother was born, and then he died —- the first is discharged as the wife of his non-contemporaneous brother, and the second as her co-wife.  [If] he performed maamar with her and [then] died —- the second requires chalitzah but may not be taken in yibum. R' Shimon says: He may perform yibum with whichever of them he wishes, or perform chalitzah with whichever of them he wishes.