#P7195. Kazuha's String

    ID: 6052 远端评测题 3000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2022“杭电杯”中国大学生算法设计超级联赛(5)

Kazuha's String

Problem Description

Kazuha has two strings $S_1$ and $S_2$ consisting of lowercase letters "$a$", "$b$" and "$c$", here are the possible operations:

Add or Delete "$aa$" at any place of the string.

Add or Delete "$bbb$" at any place of the string.

Add or Delete "$cccc$" at any place of the string.

Add or Delete "$abababab$" at any place of the string.

Add or Delete "$acacac$" at any place of the string.

Add or Delete "$bcbc$" at any place of the string.

Add or Delete "$abc$" at any place of the string.

Kazuha can operate any time with any operations, determine if $S_1$ can be transformed into $S_2$ .

Input

The first line contains one integer $T$ $(1 \le T \le 2 \times 10^5)$ .

The first line of each test case contains a single string $S_1$ .

The second line of each test case contains a single string $S_2$.

It guaranteed that the length of each string does not exceed $10^5$, and the sum of string lengths does not exceed $2 \times 10^6$.

Output

For each test case, print a single line containing "yes" if $S_1$ can be transformed into $S_2$ and "no" otherwise.

3 aa bbb bab acc acbacccac bbcacacbc
yes yes no