#include <bits/stdc++.h>
using namespace std;
int a[105], is1, is2;
int main() {
  int t, n, ok;
  cin >> t;
  while (t--) {
    cin >> n;
    ok = 1;
    is1 = is2 = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
      if (a[i] & 1)
        is1 = 1;
      else
        is2 = 1;
    }
    if (is1 && is2) ok = 0;
    puts(ok ? "YES" : "NO");
  }
  return 0;
}
