#include <bits/stdc++.h>
using namespace std;
signed main() {
  int test;
  cin >> test;
  vector<string> ans(test);
  for (int i = 0; i < test; i++) {
    int column;
    cin >> column;
    vector<int> a(column);
    for (int j = 0; j < column; j++) cin >> a[j];
    bool can = true;
    for (int j = 0; j < column; j++) {
      if (a[j] % 2 != a[0] % 2) {
        ans.push_back("NO");
        can = false;
      }
    }
    if (can)
      ans[i] = "YES";
    else
      ans[i] = "NO";
  }
  for (int i = 0; i < test; i++) cout << ans[i] << endl;
}
