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 $\}$
$(z-1)^{2}=|z-1|^{2}=(z-1)(\overline{z-1}) \Rightarrow z-1=\overline{z-1} \Rightarrow z-1$ is real $\Rightarrow z$ is real, so choose $B$.