There are $$$n$$$ bags labeled $$$1$$$ to $$$n$$$. Each bag contains a set of colored coins. A color is a lowercase letter from a to z. Within a bag, no color appears more than once.
The contents of bag $$$i$$$ are denoted by the set $$$S_i$$$.
You may apply the following operation any number of times:
The symmetric difference of two sets $$$A$$$ and $$$B$$$ is $$$$$$ A \Delta B = (A \setminus B) \cup (B \setminus A). $$$$$$
For each bag, its set of colors is given as a string of distinct lowercase letters (the order does not matter).
Your task is to determine whether it is possible to transform the initial contents of all bags into their target contents.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases.
For each test case:
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, print YES if it is possible to reach the target contents of every bag, otherwise print NO.
53a b cab bc c4a bc d eabcde bcde de e3a b ca b d1abcab2a bb b
YESYESNONONO
For the first test case, performing the operation at $$$i = 1$$$ and then at $$$i = 2$$$ is sufficient to reach the target configuration.
For the second test case, the operation can be performed sequentially at $$$i = 3, 2, 1$$$ to obtain the target configuration.
For the third test case, the contents of the last bag in the initial and target configurations are different. Since bag $$$n$$$ is never changed by any operation, it is not possible to reach the target state.
For the fourth test case, the same reasoning applies: when $$$n = 1$$$, no operation can be performed, so the initial set must already match the target set. It does not, hence the target state cannot be reached.
For the fifth test case, the only possible move is at $$$i = 1$$$. After performing it, bag $$$1$$$ becomes $$$\{a\} \Delta \{b\} = \{a,b\}$$$, and further applications just alternate between $$$\{a\}$$$ and $$$\{a,b\}$$$. Therefore, the target state cannot be reached.