M in Sm is a fixed value, which can be calculated like the numbers 1, 2, 3.
Theoretically, any letter can be used to express the meaning of "the sum of the first few items in a series", not necessarily only n, but now people are used to thinking that "Sn" is "the sum of the first few items" and Sm is only a specific case of Sn.