5. There are 2015 integers, and by taking any 2014 of them and adding them together, their sum can exactly take on the 2014 different integer values $1, 2, \cdots, 2014$. Then the sum of these 2015 integers is ( ).
(A) 1004
(B) 1005
(C) 1006
(D) 1008
5. D.

Let 2015 integers be $x_{1}, x_{2}, \cdots, x_{2015}$, and denote $x_{1}+x_{2}+\cdots+x_{2015}=M$.
Assume without loss of generality that $M-x_{i}=i(i=1,2, \cdots, 2014)$, $M-x_{2015}=A$.
Then $2014 M=1+2+\cdots+2014+A$.
Thus, the remainder when $A$ is divided by 2014 is 1007.
Therefore, $A=1007, M=1008$.
When $x_{i}=1008-i(i=1,2, \cdots, 2014), x_{2015}=1$, the condition is satisfied.