IF I'm doing it early style, just into the ashes & then pile embers on top. - I usually don't eat the skin, even when I bake them in a home oven or in a dutch oven.
Yams probably came from Sub-Saharan Africa & there the native folk put the yams directly into the hot ashes to cook over smoldering embers.
(The trick is knowing how much coals to have, so that the vegetable cooks through W/O burning up first.= That "guesstimate" is like figuring out how much coals that you need to thoroughly bake biscuits/pies/cobbler/etc. without burning the dish up. - Inside a dutch oven is likely best unless you've done it a few times directly in the hot ashes/embers, is my guess.)
Note: Inasmuch as you asked about wrapping them in foil, my governess, who was a GREAT southern/creole cook, always said that things wrapped in foil were not really baked but rather were mostly cooked by steam.
ADDENDA: The Africans that I knew cooked lots of things directly on the coals, like thick cuts of zebra/antelope. - They simply laid down a good ly pile of live coals, blew the ashes away to "glowing red" & then plopped the slab of meat onto the glowing coals, cooking it until 1/2-done & then flipping it over to cook until done.
Sometimes, they also laid down wet/green wood sticks (about the thickness of my wrist) in the coals & cooked upon that "grill".
(Incidentally, the Caribe Indians do that same "cooking technique".)
yours, satx