#include <bits/stdc++.h>
int main() {
  int t;
  std::cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    std::cin >> n;
    bool divtwo = false;
    bool notdivtwo = false;
    for (int j = 0; j < n; j++) {
      int temp;
      std::cin >> temp;
      if (temp % 2 == 0)
        divtwo = true;
      else
        notdivtwo = true;
    }
    if (divtwo && notdivtwo)
      std::cout << "NO" << std::endl;
    else
      std::cout << "YES" << std::endl;
  }
}
