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