#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
int a, b, c, d, n, m, k, kolt;
int mas[200002];
int main() {
  scanf("%d", &kolt);
  for (int _n((kolt)), hod(1); hod <= _n; hod++) {
    scanf("%d", &n);
    c = 0;
    b = 0;
    for (int _n((n)-1), i(0); i <= _n; i++) {
      scanf("%d", &mas[i]);
      c ^= mas[i];
      b += mas[i];
    }
    if (c || b == n) {
      printf("NO\n");
      continue;
    }
    vector<int> res;
    bool bad = 0;
    for (int _n((n)-1), i(0); i <= _n; i++) {
      if (!mas[i]) continue;
      if (i && mas[i - 1] == 1) continue;
      int a = i;
      while (a < n && mas[a] == 1) ++a;
      while ((a - i) % 2 == 1) {
        b = a;
        while (mas[b] == 0) ++b;
        for (int j = b - 2; j >= a; j -= 2) {
          res.push_back(j);
          mas[j] = mas[j + 1] = mas[j + 2] = 1;
          b -= 2;
        }
        if (b == a + 1) {
          res.push_back(a - 1);
          mas[a - 1] = mas[a] = mas[a + 1] = 0;
          --a;
          break;
        } else {
          while (a < n && mas[a] == 1) ++a;
        }
      }
      if (a <= i) continue;
      if (i - 1 >= 0 && mas[i - 1] == 0) {
        for (int j = i; j < a; j += 2) {
          res.push_back(j - 1);
          mas[j - 1] = mas[j] = mas[j + 1] = 0;
        }
      } else if (a < n) {
        for (int j = a - 2; j >= i; j -= 2) {
          res.push_back(j);
          mas[j] = mas[j + 1] = mas[j + 2] = 0;
        }
      } else {
        bad = 1;
        break;
      }
    }
    if (bad) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    printf("%d\n", (int)((res).size()));
    if (res.empty()) continue;
    for (int _n(((int)((res).size())) - 1), i(0); i <= _n; i++) {
      if (i) printf(" ");
      printf("%d", res[i] + 1);
    }
    printf("\n");
  }
}
