#include <bits/stdc++.h>
using namespace std;
const int prime = 151;
const long long mod = 1e9 + 7;
const int maxn = 105;
const int inf = 0x3f3f3f3f;
int t, n, a[maxn];
bool ok() {
  int flag = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] % 2 == 1) ++flag;
  }
  if (n == 1) return 1;
  if (flag < n && flag) return 0;
  return 1;
}
int main() {
  {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    if (ok())
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
