Find and list all rows of a matrix with equal element values ​​located in identical positions

Suppose I have the following matrix:

M = {{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0}, {0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0,
1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 1,
1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0}}; MatrixForm[M]; Tableform[M, TableHeadings -> {{S1, S2, S3, S4, S5, S6, S7, S8}}]

In this case, it turns out that the lines (S1, S8), (S3, S4), (S5, S6, S7) have identical element values ​​in identical line positions. I have a 1000×1000 matrix to review and would appreciate any help to code this problem.