#include <bits/stdc++.h>
using namespace std;
int height[105];
int main() {
  int k;
  ios::sync_with_stdio(false);
  cin >> k;
  while (k--) {
    int flag = 0;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> height[i];
    }
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if ((height[i] - height[j]) & 1) {
          flag = 1;
          break;
        }
      }
      if (flag) break;
    }
    if (flag)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
