Mā has the same role in both sentences.
The Two Exclamatory Verbs: Forms, Rules and Parsing