Can a residual subset of a compact connected manifold have finitely many components?

Let $(M, g)$ be a compact connected Riemann manifold without boundary. Let $A \subset M$, be residual, i.e. the intersection of countably many sets with dense interiors. Can there be finitely many open subsets $U_1, ... U_n$ of $A \cap M$, that are also closed, so that

$U_i \cap U_j = \varnothing$ for $i \neq j$ and

$\bigcup_{i=1}^n U_i = A \cap M$

Let $A$ be the complement of the equator on the sphere. It has two open components and is clearly residual.
If you want a set whose components aren't open, remove two sequences from $A$, one that converges to (but never hits) the north pole and one that converges to (but never hits) the south pole.