#include <bits/stdc++.h>
using namespace std;
const long long Maxn = 10000;
const long double pi = acos(-1);
const long long mod = 1000000007;
template <class T>
ostream &operator<<(ostream &out, vector<T> &A) {
  for (auto x : A) out << x << " ";
  return out;
}
template <class T>
ostream &operator<<(ostream &out, set<T> &A) {
  for (auto x : A) out << x << " ";
  return out;
}
template <class T1, class T2>
T1 powr(T1 a, T2 b) {
  T1 res = 1;
  for (long long i = 1; i < b + 1; i++) res = res * a;
  return res;
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long flag = 1;
    vector<long long> a(100, 0);
    vector<long long> k(n);
    for (long long i = 0; i < n; i++) {
      cin >> k[i];
      if (k[i] % 2 == 0) {
        k[i] = 0;
      } else {
        k[i] = k[i] % 2;
      }
    }
    set<long long> f;
    for (long long i = 0; i < n; i++) {
      f.insert(k[i]);
    }
    if (f.size() == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
