sn consists of letter `a`, `b` and `c`. He can transform the string by inserting or deleting substrings `aa`, `bb` and `abab`. Formally, A=uwvA = u circ w circ vA=uwv can be transformed into A′=uvA' = u circ vA′=uv and vice versa where u, v are strings and w∈{aa,bb,abab}w in {mathrm{aa}, mathrm{bb}, mathrm{abab}}w∈{aa,bb,abab}. Given the target string T=t1t2…tm, determine if Bobo can transform the string S into T.
Bobo has a string S=s1s2…snS = s_1s_2dots s_nS=s1s2…sn consists of letter `a`, `b` and `c`. He can transform the string by inserting or deleting substrings `aa`, `bb` and `abab`. Formally, A=u∘w∘vA = u circ w circ vA=u∘w∘v (``∘circ∘'' denotes string concatenation) can be transformed into A′=u∘vA' = u circ vA′=u∘v and vice versa where u, v are (possibly empty) strings and w∈{aa,bb,abab}w in {mathrm{aa}, mathrm{bb}, mathrm{abab}}w∈{aa,bb,abab}. Given the target string T=t1t2…tmT = t_1t_2dots t_mT=t1t2…tm, determine if Bobo can transform the string S into T.