1324_A. Yet Another Tetris Problem
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. the height of this figure is 2 blocks and the width of this figure is 1 block). Note that you cannot rotate these figures.

Your task is to say if you can clear the whole field by placing such figures.

More formally, the problem can be described like this:

The following process occurs while at least one a_i is greater than 0:

  1. You place one figure 2 × 1 (choose some i from 1 to n and replace a_i with a_i + 2); 
  2. then, while all a_i are greater than zero, replace each a_i with a_i - 1. 



And your task is to determine if it is possible to clear the whole field (i.e. finish the described process), choosing the places for new figures properly.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 100) — the number of test cases.

The next 2t lines describe test cases. The first line of the test case contains one integer n (1 ≤ n ≤ 100) — the number of columns in the Tetris field. The second line of the test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 100), where a_i is the initial height of the i-th column of the Tetris field.

Output

For each test case, print the answer — "YES" (without quotes) if you can clear the whole Tetris field and "NO" otherwise.

Example

Input


4
3
1 1 3
4
1 1 2 1
2
11 11
1
100


Output


YES
NO
YES
YES

Note

The first test case of the example field is shown below:

<image>

Gray lines are bounds of the Tetris field. Note that the field has no upper bound.

One of the correct answers is to first place the figure in the first column. Then after the second step of the process, the field becomes [2, 0, 2]. Then place the figure in the second column and after the second step of the process, the field becomes [0, 0, 0].

And the second test case of the example field is shown below:

<image>

It can be shown that you cannot do anything to end the process.

In the third test case of the example, you first place the figure in the second column after the second step of the process, the field becomes [0, 2]. Then place the figure in the first column and after the second step of the process, the field becomes [0, 0].

In the fourth test case of the example, place the figure in the first column, then the field becomes [102] after the first step of the process, and then the field becomes [0] after the second step of the process.
```python
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------- fast io --------------------

for _ in range(int(input())):
    n = int(input())
    a = list(map(int, input().split()))
    c1, c2 = 0, 0
    for i in range(n):
        if a[i] % 2 == 0:
            c1 += 1
        else:
            c2 += 1

    if not c1 or not c2:
        print("YES")
    else:
        print("NO")




```