Example 3 (Olympiad Training Problem from "Intermediate Mathematics" Issue 5, 2004) Let $a \in \mathbf{R}, A=\left\{x \mid 2^{1+x}+2^{1-x}=a\right\}, B=\{\sin \theta \mid$ $\theta \in \mathbf{R}\}$. If $A \cap B$ contains exactly one element, find the range of values for $a$.