#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> se;
    for (int i = 0; i < n; i++) {
      int va;
      cin >> va;
      se.insert(va & 1);
    }
    if (se.size() == 1) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
