You are given two integer arrays $$$a$$$ and $$$b$$$, both of length $$$n$$$. In one operation, choose two adjacent elements of the current array $$$a$$$. If their sum is a multiple of $$$3$$$, swap them.
Determine whether $$$a$$$ can be transformed into $$$b$$$ using any number of operations, including zero.
Each test file contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1\le T\le1000$$$). The description of the test cases follows.
The first line contains an integer $$$n$$$ ($$$1\le n\le5\cdot10^5$$$).
The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$0\le a_i\le10^9$$$).
The third line contains $$$n$$$ integers $$$b_1,b_2,\ldots,b_n$$$ ($$$0\le b_i\le10^9$$$).
For each test file, it is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$5\cdot10^5$$$.
For each test case, print Yes on a separate line if $$$a$$$ can be transformed into $$$b$$$, and No otherwise.
531 2 42 1 420 33 031 4 24 1 230 1 33 1 031 2 11 1 2
YesYesNoNoYes
In the first test case, swapping the first two elements gives the target array, since $$$1+2=3$$$.
In the fourth test case, the middle element cannot be swapped with either neighbor, so the two end elements cannot be exchanged.
| Name |
|---|


