Find the number of subsets $A \subset M = \{2^0, 2^1, 2^2, \dots, 2^{2005}\}$ such that the equation $x^2 - S(A)x + S(B) = 0$ has integral roots, where $S(M)$ is the sum of all elements of $M$, and $B = M \setminus A$ ($A$ and $B$ are not empty).

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