#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    int odd, even;
    odd = even = 0;
    int x;
    while (n--) {
      cin >> x;
      x %= 2;
      odd += x;
      even += (!x);
    }
    if (odd && !even || even && !odd)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
