#include <bits/stdc++.h>
using namespace std;
int v[200005];
vector<int> rz;
vector<int> pzs;
void upd(int pz) {
  int val = (v[pz] ^ v[pz + 1] ^ v[pz + 2]);
  v[pz] = v[pz + 1] = v[pz + 2] = val;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, i, n, m, r, s, j, q;
  cin >> t;
  while (t--) {
    cin >> n;
    int cnt = 0;
    for (i = 1; i <= n; ++i) {
      cin >> v[i];
      cnt += v[i];
    }
    if (cnt & 1) {
      cout << "NO\n";
      continue;
    }
    pzs.clear();
    rz.clear();
    for (i = 1; i <= n; ++i) {
      if (v[i]) pzs.push_back(i);
    }
    v[0] = v[n + 1] = 1;
    for (i = 0; i < pzs.size(); i += 2) {
      int a = pzs[i];
      int b = pzs[i + 1];
      if ((b - a) % 2 == 0) {
        for (j = a; j < b; j += 2) {
          upd(j);
          rz.push_back(j);
        }
        for (j = b - 4; j >= a; j -= 2) {
          upd(j);
          rz.push_back(j);
        }
      } else {
        if (v[a - 1] == 0) {
          for (j = a; j < b - 1; j += 2) {
            upd(j);
            rz.push_back(j);
          }
          for (j = a - 1; j <= b - 2; j += 2) {
            upd(j);
            rz.push_back(j);
          }
        }
      }
    }
    int ok = 1;
    for (i = pzs.size() - 1; i >= 0; i -= 2) {
      int b = pzs[i];
      int a = pzs[i - 1];
      if (v[a] == 0) continue;
      assert((b - a) % 2 == 1);
      if (v[b + 1] != 0) ok = 0;
      for (j = b - 2; j > a; j -= 2) {
        upd(j);
        rz.push_back(j);
      }
      for (j = b - 1; j >= a; j -= 2) {
        upd(j);
        rz.push_back(j);
      }
    }
    if (!ok) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    cout << rz.size();
    cout << '\n';
    for (i = 0; i < rz.size(); ++i) cout << rz[i] << ' ';
    cout << '\n';
  }
  return 0;
}
