#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a, b, flag = 0;
    cin >> a;
    a = a % 2;
    for (long long i = 1; i < n; i++) {
      cin >> b;
      if (b % 2 != a) {
        flag = 1;
      }
    }
    if (!flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
