#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int t, n, a[maxn], ret = 0;
inline int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * t;
}
int main(void) {
  t = read();
  while (t--) {
    ret = 0;
    n = read();
    for (int i = 0; i < n; i++) {
      a[i] = read();
      if (a[i] % 2 == 0) {
        ret++;
      }
    }
    if (ret == 0 || ret == n) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
  return 0;
}
