Yam is a slur used to describe Blacks in a derogatory way. Term used extensively by the military in Robert O'Connors novel "Buffalo Soldiers" about US Soldiers stationed in Germany. Originates probably with the food which is a staple of southern cooking.
The word Yam is a racial slur that has been used historically to degrade and dehumanize blacks. The word is still used by some people for this purpose, and it is seen as offensive and hurtful to blacks. If you are unsure about whether or not it is appropriate to use the word Yam, it is best to err on the side of caution and avoid using it in any situation.