Busy Beaver has a string $$$A$$$ made up of characters $$$\texttt{P}$$$ and $$$\texttt{N}$$$. He can perform two types of operations on $$$A$$$:
Busy Beaver has a target string $$$B$$$. Determine if he can turn $$$A$$$ into $$$B$$$ after some number of operations.
$$$^{\text{∗}}$$$A substring of length $$$k$$$ is a contiguous sequence of $$$k$$$ adjacent characters of a string.
The first line contains a single integer $$$T$$$ ($$$1 \leq T \leq 10^4$$$) — the number of test cases.
The only line of each test case contains the strings $$$A$$$ and $$$B$$$ ($$$1 \leq |A|, |B| \leq 10^5$$$), consisting of characters $$$\texttt{P}$$$ and $$$\texttt{N}$$$.
The sum of $$$|A|+|B|$$$ across all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output YES if Busy Beaver can turn $$$A$$$ into $$$B$$$ using the operations above, and NO otherwise.
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
7P NPPNPN NPPNPP NPNPN PPNPPNPP PPNNNNNNNNNNNNNNNNNNPPPNNPPNNPP NNPPNNPPNNNPNNNNNPN PPPN
YESYESNONOYESNONO
In the first test case, we can perform one operation to turn $$$\texttt{P}$$$ into $$$\texttt{NP}$$$.
In the second test case, we can do two operations: $$$\texttt{P}\color{red}{\texttt{NP}}\texttt{N} \to \texttt{P}\color{red}{\texttt{P}}\texttt{N}$$$ and then $$$\color{red}{\texttt{P}}\texttt{PN} \to \color{red}{\texttt{NP}}\texttt{PN}$$$.
In the third test case, we can show that it is not possible to turn $$$\texttt{PP}$$$ into $$$\texttt{NP}$$$ using any number of operations.