#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int c[2] = {0, 0};
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    c[x & 1]++;
  }
  if (c[0] * c[1] == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  int t;
  for (scanf("%d", &t); t--;) {
    solve();
  }
  return 0;
}
