Ma'am does not have to be capitalized, except where situationally apropriate such as when it is the first word in a sentence.
You spelled it correctly: Yes, ma'am.
Sí, señora.
YES! Black Slaves started saying "yes ma'am" and "Yes Sir" as a sign of recognition, however, what masters did not realize was that the slaves were actually calling them vulgar names!
Ja, meine Dame