#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int c[t];
  for (int k = 0; k < t; k++) {
    c[k] = 1;
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if ((a[j] + a[i]) % 2 != 0) {
          c[k] = 0;
          break;
        }
      }
    }
  }
  for (int i = 0; i < t; i++) {
    if (c[i] == 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
