409710: GYM103688 L Let's Swap

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. Let's Swaptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Joseph developed an editing software called Pandote recently, and now he is testing it to make sure it works correctly, otherwise, he will probably get fired!

Joseph starts his testing by implementing copying and pasting as well as reversing operations to the string on the Pandote. More specifically, in each step, if the string on the screen is $$$S$$$, he will do the following operations in order.

  1. Choose a prefix of length $$$l ~ (1 \leq l \leq |S|)$$$, then $$$S$$$ can be denoted by $$$AB~(|A|=l)$$$. Note that the string $$$B$$$ can be empty.
  2. Swap the two parts and get the string $$$BA$$$.
  3. Reverse the whole string and get the string $$$(BA)^r$$$

However, since the function of Pandote is limited, there are only two different lengths $$$l_1$$$ and $$$l_2$$$ of prefix he can choose in each step. Now Joseph wants to know whether he can convert the string $$$S$$$ to $$$T$$$ through several (possibly zero) steps.

Input

The first line of the input gives the number of test cases $$$T ~ (1 \leq T \leq 5\times 10 ^ 5)$$$. $$$T$$$ test cases follow.

For each test case, the first line contains the string $$$S$$$ and the second line contains the string $$$T$$$. Both $$$S$$$ and $$$T$$$ are consisting of lowercase Latin letters and $$$|S|=|T|$$$.

the third line contains two integers $$$l_1$$$ and $$$l_2 ~(1 \leq l_1,l_2 \leq |S|, l_1 \neq l_2)$$$, denoting the length of the prefix he can choose in each step.

It is guaranteed that the sum of $$$|S|$$$ over all test cases does not exceed $$$5 \times 10^5$$$.

Output

For each test case, print yes if he can convert $$$S$$$ to $$$T$$$. Otherwise, print no.

ExampleInput
3
ljhelloh
hellohlj
2 4
thisisastr
htrtsasisi
3 5
abcde
bcdea
1 4
Output
yes
no
yes
Note

For the first testcase, one possible method is $$$\texttt{ljhelloh} \stackrel{4}{\longrightarrow} \texttt{ehjlholl} \stackrel{2}{\longrightarrow}\texttt{hellohlj} $$$

加入题单

算法标签: