#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int oops = 1 << 20;
const int SMALLN = 11;
struct Triple {
  int a, b, c;
};
int best[40][1 << 15];
int decision[40][1 << 15];
vector<Triple> triples, minitriples;
int arr[MAXN + 5];
int n;
void gen(int K, int n, vector<Triple>& triples) {
  for (int i = 0; i < n; i++) {
    for (int k = 1; k <= K && i + 2 * k < n; k++) {
      triples.push_back({i, i + k, i + k + k});
    }
  }
}
int solve(int t, int mask) {
  if (t == triples.size()) {
    if (mask == 0) return 0;
    return oops;
  }
  int& ret = best[t][mask];
  if (~ret) return ret;
  decision[t][mask] = 1;
  ret = 1 + solve(t + 1, mask ^ (1 << triples[t].a) ^ (1 << triples[t].b) ^
                             (1 << triples[t].c));
  int other = solve(t + 1, mask);
  if (other < ret) {
    ret = other;
    decision[t][mask] = 0;
  }
  return ret;
}
void printMask(int mask) {
  for (int i = 0; i < n; i++) printf("%d", !!(mask & (1 << i)));
  printf("\n");
}
vector<Triple> getSteps(int mask) {
  solve(0, mask);
  vector<Triple> ret;
  int t = 0;
  for (int t = 0; mask; t++) {
    if (decision[t][mask]) {
      ret.push_back(triples[t]);
      mask = mask ^ (1 << triples[t].a) ^ (1 << triples[t].b) ^
             (1 << triples[t].c);
    }
  }
  return ret;
}
int main() {
  int c, c2;
  memset(best, -1, sizeof(best));
  scanf("%d", &n);
  gen(n, min(n, SMALLN), triples);
  int wantedMask = 0;
  for (c = 0; c < n; c++) {
    int x;
    scanf("%d", &x);
    if (x) wantedMask |= (1 << c);
    arr[c] = x;
  }
  vector<Triple> ret;
  if (n <= SMALLN) {
    int ans = solve(0, wantedMask);
    if (ans == oops) {
      printf("NO\n");
      return 0;
    } else {
      ret = getSteps(wantedMask);
    }
  } else {
    int kk = 5;
    gen(kk, 2 * kk + 1, minitriples);
    for (c = 0; c + 2 * kk < n; c++) {
      if (!arr[c]) continue;
      int mask = 0;
      for (int i = 0; i < 6; i++) mask |= arr[c + i] << i;
      bool found = false;
      for (int i = 0; i < minitriples.size(); i++) {
        if (((mask ^ (1 << minitriples[i].a) ^ (1 << minitriples[i].b) ^
              (1 << minitriples[i].c)) &
             7) == 0) {
          found = true;
          int i1 = c + minitriples[i].a, i2 = c + minitriples[i].b,
              i3 = c + minitriples[i].c;
          ret.push_back({i1, i2, i3});
          arr[i1] ^= 1;
          arr[i2] ^= 1;
          arr[i3] ^= 1;
          break;
        }
      }
      for (int i = 0; i < minitriples.size() && !found; i++) {
        for (int j = i + 1; j < minitriples.size(); j++) {
          int ix[] = {minitriples[i].a, minitriples[i].b, minitriples[i].c,
                      minitriples[j].a, minitriples[j].b, minitriples[j].c};
          int newMask = mask;
          for (int jj = 0; jj < 6; jj++) newMask ^= 1 << ix[jj];
          if ((newMask & 63) == 0) {
            for (int jj = 0; jj < 6; jj++) arr[ix[jj] += c] ^= 1;
            ret.push_back({ix[0], ix[1], ix[2]});
            ret.push_back({ix[3], ix[4], ix[5]});
            found = true;
            break;
          }
        }
      }
    }
    wantedMask = 0;
    for (int i = n - 1; i >= n - SMALLN; i--)
      wantedMask |= arr[i] << (n - i - 1);
    vector<Triple> lastSteps = getSteps(wantedMask);
    for (Triple step : lastSteps) {
      step.a = n - step.a - 1;
      step.b = n - step.b - 1;
      step.c = n - step.c - 1;
      arr[step.a] ^= 1;
      arr[step.b] ^= 1;
      arr[step.c] ^= 1;
      ret.push_back(step);
    }
  }
  printf("YES\n");
  printf("%d\n", ret.size());
  for (Triple triple : ret) {
    printf("%d %d %d\n", triple.a + 1, triple.b + 1, triple.c + 1);
  }
}
