5. There are 4 squares with side lengths of $a$, $a+3$, $a+5$, and $a+6$, and the sum of their areas is denoted as $M$; there are also 4 squares with side lengths of $a+1$, $a+2$, $a+4$, and $a+7$, and the sum of their areas is denoted as $N$. The relationship between $M$ and $N$ is ( ).
(A) $M>N$
(B) $M=N$
(C) $M<N$
(D) Cannot be determined
5. B.
$$
\begin{array}{l}
M=a^{2}+(a+3)^{2}+(a+5)^{2}+(a+6)^{2} \\
=4 a^{2}+28 a+70, \\
N=(a+1)^{2}+(a+2)^{2}+(a+4)^{2}+(a+7)^{2} \\
=4 a^{2}+28 a+70 .
\end{array}
$$

Therefore, $M=N$.