#include <bits/stdc++.h>
using namespace std;
int main() {
  int c;
  while (cin >> c) {
    while (c--) {
      int n;
      cin >> n;
      vector<int> vec(n);
      bool flag = true;
      for (auto &i : vec) {
        cin >> i;
      }
      flag = vec[0] % 2;
      bool flg = true;
      for (int i = 1; i < vec.size(); i++) {
        if (vec[i] % 2 != flag) {
          flg = false;
          break;
        }
      }
      if (flg) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}
