No, you can't. Yams and sweet potatoes are entirely different vegetables. However, in the United States, sweet potatoes are sometimes mistakenly called yams (it even happened on the TV Series Friends, in a thanksgiving episode), although those two veggies have nothing in common. Even in some supermarkets, sweet potatoes are sold under the yams label. In this case, then, yes, you can use yams for sweet potatoes - since by purchasing yams, you'll actually get sweet potatoes.