As Ham was made to suffer requital for his irreverence, so Shem and Japheth received a reward for the filial, deferential way in which they took a garment and laid it upon both their shoulders, and walking backward, with averted faces, covered the nakedness of their father. Naked the descendants of Ham, the Egyptians and Ethiopians, were led away captive and into exile by the king of Assyria, while the descendants of Shem, the Assyrians, even when the angel of the Lord burnt them in the camp, were not exposed, their garments remained upon their corpses unsinged. And in time to come, when Gog shall suffer his defeat, God will provide both shrouds and a place of burial for him and all his multitude, the posterity of Japheth.
Shem and Japheth Walked Backward to Cover Their Father
Legends of the Jews 4:77