#include <bits/stdc++.h>
using namespace std;
int t, n, x;
void solve() {
  int o = 0, e = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x & 1)
      o++;
    else
      e++;
  }
  if (o > 0 && e > 0) {
    cout << "NO";
  } else
    cout << "YES";
}
int main() {
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
}
