Let $I_{m} = \int_{0}^{2 \pi} \cos (x) \cos (2 x) \cdots \cos (m x) d x$. For which integers $m, 1 \leqslant m \leqslant 10$, is $I_{m} \neq 0$? Please provide the sum of all such integers $m$. 

Let's think step by step and output the final answer within \boxed{}.
user