#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n;
  cin >> t;
  while (t--) {
    string ans = "YES";
    cin >> n;
    long long arr[n], maxi = -1;
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
      maxi = max(maxi, arr[i]);
    }
    for (long long i = 0; i < n; i++) {
      if ((maxi - arr[i]) % 2 != 0) {
        ans = "NO";
        break;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
