#P13972. [VKOSHP 2024] Prank

[VKOSHP 2024] Prank

题目描述

Katya formed the word s1s_1 from blocks, but when she returned to the room, she saw her brother Andrey running out. Now the word made from the blocks looked different --- s2s_2. Andrey admitted that he played a little prank\textit{prank}. His prank consisted of the following: Andrey would choose a position and then insert two blocks with the same letter next to it. He could place these two blocks at the beginning of the string, at the end of the string, or between two neighboring blocks.

Help Katya determine whether Andrey told the truth, that is, whether the string s2s_2 could have been obtained from the string s1s_1 by possibly applying several pranks\textit{pranks}.

输入格式

One test contains several sets of input data.

The first line contains one integer tt --- the number of sets of input data (1t5000001 \le t \le 500\,000).

In the first line of each set description, there is one string s1s_1 --- the word from the blocks that Katya originally had.

In the second line of each set description, there is one string s2s_2 --- the word from the blocks that Andrey obtained.

It is guaranteed that all words consist of lowercase Latin letters. The total length of all words does not exceed 10000001\,000\,000.

输出格式

For each set of input data, output YES\texttt{YES}, if Andrey could be telling the truth, and NO\texttt{NO} otherwise.

2
hello
havvaeeello
test
tesssst
YES
NO