#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    vector<int> x{};
    for (int j = 0; j < n; j++) {
      int y;
      cin >> y;
      x.push_back(y);
    }
    sort(begin(x), end(x));
    bool ans = true;
    for (int j = 1; j < n; j++)
      if ((x[j] - x[j - 1]) % 2 != 0) ans = false;
    if (ans)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
