#include <bits/stdc++.h>
using namespace std;
int a[120];
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int Max = -1;
    for (int i = 0; i < n; ++i) cin >> a[i], Max = max(Max, a[i]);
    bool f = false;
    for (int i = 0; i < n; ++i) {
      int d = Max - a[i];
      if (d % 2 == 1) {
        f = true;
        break;
      }
    }
    if (f)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
