#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    memset(a, 0, sizeof(a));
    if (n == 1) {
      int b;
      cin >> b;
      printf("YES\n");
    } else {
      int f = 0;
      int j = 0, o = 0;
      for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (a[i] % 2 == 1)
          j++;
        else
          o++;
      }
      if (j >= 1 && o >= 1) {
        f = 1;
      }
      if (f == 1)
        printf("NO\n");
      else
        printf("YES\n");
    }
  }
  return 0;
}
