#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long count = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 0) count++;
    }
    if (count == n || count == 0) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
}
