Solution (source code)

= Solution

The <jump chain> of $(X_t)$ is exactly $(Y_m)$: from $i$ it visits $j$ next with probability $p_{ij}$. Consequently the two chains have exactly the same directed paths of positive-probability transitions. Thus
$$
\boxed{X\text{ is irreducible}\iff Y\text{ is irreducible}.}
$$