#include <bits/stdc++.h>
using namespace std;
int T, n;
int a[200];
int main() {
  scanf("%d", &T);
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    int f1 = 0, f2 = 0;
    for (int i = 1; i <= n; ++i) {
      if (f1 == 1 && f2 == 1) {
        break;
      }
      if (a[i] % 2 == 1) f1 = 1;
      if (a[i] % 2 == 0) f2 = 1;
    }
    if (f1 + f2 == 2)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
