#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, even = 0, odd = 0;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (odd == 0 || even == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
signed main() {
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
