#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, i, c = 0, a[102];
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 0) c++;
    }
    if (c == 0 || c == n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
