#include <bits/stdc++.h>
using namespace std;
long long int ctoi(char a) {
  long long int x = a - 48 - 48;
  return x;
}
string itos(long long int a) {
  string out_string;
  stringstream second;
  second << a;
  out_string = second.str();
  return out_string;
}
char itoc(long long int a) { return itos(a)[0]; }
long long int pow(long long int e, long long int x) {
  long long int ans = 1;
  while (x > 0) {
    if (x & 1) ans *= e;
    e *= e;
    x >>= 1;
  }
  return ans;
}
string bin(long long int x) {
  bitset<sizeof(1) * CHAR_BIT> bits(x);
  string b = bits.to_string();
  return b;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int T = 1;
  cin >> T;
  while (T--) {
    long long int n, k, m, x, y;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int f = a[0] % 2;
    bool ans = 0;
    for (long long int i = 1; i < n; i++) {
      if (a[i] % 2 != f) {
        ans = 1;
        break;
      }
    }
    cout << (ans ? "NO\n" : "YES\n");
  }
  return 0;
}
