#include <bits/stdc++.h>
using namespace std;
int t, n, a[110];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    for (int i = 0; i < n; i++) a[i] %= 2;
    int sum = 0;
    for (int i = 0; i < n; i++) sum += a[i];
    if (sum == 0 || sum == n)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
