#include <bits/stdc++.h>
using namespace std;
long long root(vector<long long> arr, long long i) {
  while (arr[i] != i) {
    i = arr[i];
  }
  return i;
}
void union_function(long long a, long long b, vector<long long> &arr,
                    vector<long long> &size) {
  long long root_a = root(arr, a);
  long long root_b = root(arr, b);
  if (size[root_a] < size[root_b]) {
    arr[root_a] = arr[root_b];
    size[root_b] += size[root_a];
  } else {
    arr[root_b] = arr[root_a];
    size[root_a] += size[root_b];
  }
}
int main() {
  int t;
  cin >> t;
  while (t-- > 0) {
    int n, i;
    cin >> n;
    vector<int> arr(n);
    for (i = 0; i < n; ++i) {
      cin >> arr[i];
    }
    sort(arr.begin(), arr.end());
    for (i = 1; i < n; ++i) {
      if ((arr[i] - arr[i - 1]) % 2 != 0) {
        cout << "NO\n";
        break;
      }
    }
    if (i == n) {
      cout << "YES\n";
    }
  }
}
