"And the wheat and the spelt were not struck, for they are afilot" (Exodus 9:32). What is "afilot"? The Holy One, blessed be He, worked wonders [pela'im] with them. Rabbi Judah says: they were late-ripening. Rabbi Pinchas said to him: is it not written, "and every herb of the field" [was struck]? And you say it was because they were small that they were not struck? Rather, the Holy One, blessed be He, worked wonders with them. "The LORD is righteous, and I and my people are the wicked ones" (Exodus 9:27). He justified the judgment against himself. And what reward did he take for this? That they were given a place of burial, as it is said, "You stretched out Your right hand, the earth swallowed them" (Exodus 15:12). The wicked do not give thanks until He brings plagues upon them, but the righteous are not so; therefore it is said, "Sing for joy, O righteous ones, in the LORD" (Psalms 33:1), as it is said, "And all the people saw and sang." It is not written here, "Sing for joy, O righteous ones, the LORD," but rather "in the LORD" - at the time when they see Him. So it says, "And Israel saw the great hand" (Exodus 14:31), and they began to sing, "Then Moses sang" (Exodus 15:1). "When I go out of the city" (Exodus 9:29). Here is an argument from the lighter to the weightier: if prayer, which is the lighter, was not possible in Egypt [proper], how much more so speech [of prophecy], which is the weightier. And what is written, "the LORD said to Moses and to Aaron in the land of Egypt" (Exodus 12:1) - that was outside the metropolis.
The Wheat Spared by Wonder and Pharaoh's Confession
Yalkut Shimoni on Torah 186:2
(שמות ט כה-לג) וְהַחִטָּה וְהַכֻּסֶּמֶת לֹא נֻכּוּ כִּי אֲפִילֹת הֵנָּה. מַהוּ כִּי אֲפִילֹת. פְּלָאִים עָשָׂה הַקָּדוֹשׁ בָּרוּךְ הוּא בָּהֶם. רַבִּי יְהוּדָה אוֹמֵר, לְקוּשׁוֹת הָיוּ. אָמַר לוֹ רַבִּי פִּנְחָס, וַהֲלֹא כְּתִיב וְאֵת כָּל עֵשֶׂב הַשָּׂדֶה, וְאַתְּ אַמְרֵת בִּשְׁבִיל שֶׁהָיוּ קְטַנּוֹת לֹא נֻכּוּ, אֶלָּא פְּלָאִים עָשָׂה הַקָּדוֹשׁ בָּרוּךְ הוּא בָּהֶם. (שמות ט כז) ה' הַצַּדִּיק וַאֲנִי וְעַמִּי הָרְשָׁעִים. הִצְדִּיק עָלָיו אֶת הַדִּין, וּמַה שָּׂכָר נָטַל עַל כָּךְ, שֶׁנִּתַּן לָהֶם מְקוֹם קְבוּרָה שֶׁנֶּאֱמַר (שמות טו, יב) "נָטִיתָ יְמִינְךָ תִּבְלָעֵמוֹ אָרֶץ". הָרְשָׁעִים אֵינָן מְרַנְּנִין עַד שֶׁהוּא מֵבִיא עֲלֵיהֶם מַכּוֹת, [אֲבָל הַצַּדִּיקִים אֵינָן כֵּן], לְכָךְ נֶאֱמַר (תהלים לג, א) "רַנְּנוּ צַדִּיקִים בַּה'", שֶׁנֶּאֱמַר "וַיַּרְא כָּל הָעָם וַיָּרֹנוּ", "רַנְּנוּ צַדִּיקִים ה'" אֵין כְּתִיב כָּאן, אֶלָּא בַּה', בִּזְמַן שֶׁהֵן רוֹאִין אוֹתוֹ, וְכֵן הוּא אוֹמֵר (שמות יד, לא) "וַיַּרְא יִשְׂרָאֵל אֶת הַיָּד הַגְּדֹלָה", הִתְחִילוּ מְרַנְּנִין (שמות טו, א) "אָז יָשִׁיר מֹשֶׁה". כְּצֵאתִי אֶת הָעִיר. וַהֲלֹא דְּבָרִים קַל וָחֹמֶר, וּמַה תְּפִלָּה קַלָּה לֹא הָיָה בְּמִצְרַיִם, דִּבּוּר חָמוּר לֹא כָּל שֶׁכֵּן, וּמַה שֶּׁכָּתוּב (שמות יב, א) ["וַיֹּאמֶר] ה' אֶל מֹשֶׁה וְאֶל אַהֲרֹן בְּאֶרֶץ מִצְרַיִם", חוּץ לַכְּרַךְ.