#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, n, trans = 0, cnt = 0, b, c, m, s, d;
  vector<int> v, vd;
  cin >> n;
  for (long long x = 0; x < n; x++) {
    cin >> m;
    v.clear();
    for (long long j = 0; j < m; j++) {
      cin >> d;
      v.push_back(d);
    }
    sort(v.rbegin(), v.rend());
    vd.clear();
    trans = 0;
    for (long long j = 1; j < v.size(); j++) {
      if ((v[j] - v[0]) % 2 != 0) {
        trans = 1;
        cout << "NO" << endl;
        break;
      }
    }
    if (trans == 0) cout << "YES" << endl;
  }
}
