#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, i;
    cin >> n;
    long long ar[n];
    for (i = 0; i < n; i++) cin >> ar[i];
    long long ma, mb, flag = 0;
    ;
    ma = *max_element(ar, ar + n);
    for (i = 0; i < n; i++)
      if (abs(ar[i] - ma) % 2 != 0) {
        flag = 1;
        break;
      }
    if (flag == 0)
      cout << "YES \n";
    else
      cout << "NO \n";
  }
  return 0;
}
