5. If the equation ||$y^{2}-1|-2|=m$ has exactly five distinct real roots, then $m=(\quad$ ).
(A) 0
(B) 1
(C) 2
(D) greater than 2
5. B.

When $m=1$, the original equation is $\left|y^{2}-1\right|=3$ or 1.
Therefore, there are five different real roots $\pm 2, \pm \sqrt{2}, 0$.