Suppose that $G= G_1 \times \dots\times G_r$ be a decomposition of group $G$ into its normal subgroups. Let $H_i \leq G_i$ for every $i$. We know that for every $i \neq j$, we have $[G_i, G_j]=1$ and so $[H_i, H_j]=1$.
a) Is it true that $H := H_1 H_2 \cdots H_r$ is a subgroup of $G$?
b) Is it true that $H = H_1 \times H_2 \times \dots \times H_r$?