A new digital device for storing information is being studied. Information on the device is stored as a sequence of cells, each of which is in one of two states, denoted by the symbols "+" and "-", and thus stores one bit of information.
We define a fragment as a group of adjacent cells with the same state, such that to its left there is either no cell or a cell in the opposite state, and to its right there is either no cell or a cell in the opposite state.
A write operation allows choosing any pair of adjacent fragments of different lengths and changing the state of all cells in the shorter fragment to the opposite, thereby merging two or three adjacent fragments into one.
You are required to write a program that, given an initial and a final sequence of cell states, determines whether the final sequence can be obtained from the initial sequence using a sequence of write operations.
Input
The first line of the input contains a positive integer $q$ — the number of test cases.
Each of the following $q$ lines contains $s_i, t_i$ — non-empty sequences of "+" and "-" symbols of equal length, separated by a single space. This line means that in test case $i$, it is required to obtain the final sequence $t_i$ from the initial sequence of cell states $s_i$.
Output
The output should contain $q$ lines, where the $i$-th line is "Yes" if the final sequence $t_i$ can be obtained from the initial sequence $s_i$, or "No" otherwise.
Examples
Input 1
3 ++- +++ ++-- ++++ ++-+--+- ++++++++
Output 1
Yes No Yes
Input 2
3 ++-+-- ++---- ++-+-- +++--- -++- -++-
Output 2
Yes No Yes
Subtasks
| Subtask | Points | Constraints | Required Subtasks | ||
|---|---|---|---|---|---|
| 1 | 20 | $\sum | s_i | \leqslant 16$, $t_i$ consists of "+" symbols | – |
| 2 | 30 | $\sum | s_i | \leqslant 1000$, $t_i$ consists of "+" symbols | 1 |
| 3 | 20 | $\sum | s_i | \leqslant 10^6$, $t_i$ consists of "+" symbols | 1, 2 |
| 4 | 20 | $\sum | s_i | \leqslant 1000$ | 1, 2 |
| 5 | 10 | $\sum | s_i | \leqslant 10^6$ | 1–4 |