#include <bits/stdc++.h>
using namespace std;
int t, n, m, k, sum, a[11111117], b[11111117], h, l, r;
string s, u;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n;
    k = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    for (int i = 2; i <= n; ++i) {
      if (i == n)
        a[i] = a[i] - a[1] + 2;
      else
        a[i] = a[i] - a[1];
    }
    a[1] = 0;
    for (int i = 1; i <= n; ++i) {
      if (a[i] % 2 == 0) k++;
    }
    if (k == n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
