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