#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << "\n";
  err(++it, args...);
}
bool vis[1000] = {false};
long long check = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, k, x, y, b, c, v, var, n, m, z, ans = 0, ind1, ind2, flag = 0,
                                                  limit1, limit2, limit3;
  long long tt;
  cin >> tt;
  while (tt--) {
    cin >> n;
    long long arr[n];
    for (i = 0; i < n; i++) {
      cin >> arr[i];
    }
    flag = 0;
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (abs(arr[i] - arr[j]) % 2 == 1) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
