## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] Consecutive XOR Codechef Solution

Chef has two binary strings $A$ and $B$, both having length $N$. He can perform the following operation on $A$ any number of times (possibly zero):

• Select any index $i$ $\left(1\le i\le N-1\right)$ and simultaneously set ${A}_{i}:={A}_{i}\oplus {A}_{i+1}$ and ${A}_{i+1}:={A}_{i}\oplus {A}_{i+1}$. Formally, if initially ${A}_{i}=x$ and ${A}_{i+1}=y$ then set ${A}_{i}:=x\oplus y$ and ${A}_{i+1}:=x\oplus y$

Here, $\oplus$ denotes the bitwise XOR operation.

Chef wants to determine if it is possible to make $A$ equal to $B$ by applying the above operation any number of

Solution Click Below:-  👉
👇👇👇👇👇

times. Can you help Chef?

### Input Format

• The first line contains a single integer $T$ — the number of test cases. Then the test cases follow.
• The first line of each test case contains an integer $N$ — the length of the binary string $A$.
• The second line of each test case contains the binary string $A$ of length $N$.
• The third line of each test case contains the binary string $B$ of length $N$.

### Output Format

For each test case, output YES if Chef can make string $A$ equal to string $B$ by applying the above operation any number of times. Otherwise, output NO.

You may print each character of YES and NO in uppercase or lowercase (for example, yesyEsYes will be considered identical).

### Constraints

• $1\le T\le {10}^{5}$
• $2\le N\le {10}^{5}$
• The sum of $N$ over all test cases does not exceed