#include <bits/stdc++.h>
using namespace std;
int ar[105];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> ar[i];
    }
    sort(ar + 1, ar + 1 + n);
    bool f = 1;
    for (int i = 2; i <= n; i++) {
      int v = ar[i] - ar[i - 1];
      if (v % 2 != 0) f = 0;
    }
    if (f) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
