2. Let $z$ be a complex number, $M=\left\{z\left|(z-1)^{2}=\right| z-\left.1\right|^{2}\right\}$, then
A. $M=\{$ pure imaginary numbers $\}$
B. $M=\{$ real numbers $\}$
C. $\{$ real numbers $\} \subsetneq M \subsetneq\{$ complex numbers $\}$
D. $M=\{$ complex numbers $\}$