#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
void solve() {
  int n;
  cin >> n;
  vi a(n), freq(2);
  for (int& x : a) cin >> x, freq[x]++;
  if (freq[0] == 0) {
    cout << "NO\n";
    return;
  }
  vi ans;
  auto op = [&](int i) {
    ans.push_back(i);
    a[i] = a[i + 1] = a[i + 2] = a[i] ^ a[i + 1] ^ a[i + 2];
  };
  for (int z = 0; z < 2; z++) {
    int left = 0;
    for (int i = 0; i + 2 < n; i++) {
      if (a[i] + a[i + 1] + a[i + 2] == 2 && left % 2 == 0) {
        int idx = i;
        left += 2;
        while (left > 0) {
          op(idx);
          left -= 2;
          idx -= 2;
        }
        i++;
        continue;
      }
      if (i > 0 && a[i - 1] && a[i - 1] + a[i] + a[i + 1] == 1) op(i - 1);
      left += a[i];
    }
  }
  bool bad = ans.size() > n;
  for (int i : a)
    if (i) bad = 1;
  if (bad) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  cout << ans.size() << "\n";
  for (int i : ans) cout << i + 1 << " ";
  cout << "\n";
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
