#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, n, m = 0, mi = 101, e = 0, o = 0;
  cin >> t;
  while (t--) {
    e = 0;
    o = 0;
    m = 0;
    mi = 101;
    cin >> n;
    int a[n];
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > m) {
        m = a[i];
      }
      if (a[i] < mi) {
        mi = a[i];
      }
      if (a[i] % 2 == 0) {
        e = 1;
      } else {
        o = 1;
      }
    }
    if ((m - mi) % 2 != 0) {
      cout << "NO"
           << "\n";
    } else {
      if (e == o)
        cout << "NO"
             << "\n";
      else
        cout << "YES"
             << "\n";
    }
  }
  return 0;
}
