#include <bits/stdc++.h>
using namespace std;
class opt {
 public:
  int a, b, c;
};
int n, a[100010], popcnt[1048576];
int cmp(int x, int y) { return popcnt[x] < popcnt[y]; }
void apply(opt x) {
  a[x.a] ^= 1;
  a[x.b] ^= 1;
  a[x.c] ^= 1;
}
vector<opt> ans, status[64];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int K = n;
  vector<opt> cur;
  for (int i = -5; i <= 6; i++) {
    for (int j = i + 1; j <= 6; j++) {
      if (i * 2 - j > -5 && j > 0) cur.push_back((opt){i * 2 - j, i, j});
    }
  }
  for (int S = 1; S < 64; S++) {
    bool buf[7];
    for (int i = 1; i <= 6; i++) buf[i] = ((S >> (i - 1))) & 1;
    auto app = [&](opt x) {
      if (x.a >= 1) buf[x.a] ^= 1;
      if (x.b >= 1) buf[x.b] ^= 1;
      if (x.c >= 1) buf[x.c] ^= 1;
    };
    for (auto &x : cur) {
      app(x);
      int ts = 0;
      for (int i = 1; i <= 6; i++) ts = (ts << 1) | buf[i];
      if (!ts) {
        status[S] = vector<opt>(1, x);
        goto bk;
      }
      for (auto &y : cur) {
        app(y);
        int ts = 0;
        for (int i = 1; i <= 6; i++) ts = (ts << 1) | buf[i];
        if (!ts) {
          status[S] = vector<opt>({x, y});
          goto bk;
        }
        app(y);
      }
      app(x);
    }
    assert(0);
  bk:;
  }
  while (K > 10) {
    int S = 0;
    for (int i = K; i > K - 6; i--) S = (S << 1) | a[i];
    for (auto &x : status[S])
      ans.push_back((opt){x.a + K - 6, x.b + K - 6, x.c + K - 6}),
          apply((opt){x.a + K - 6, x.b + K - 6, x.c + K - 6});
    K -= 6;
  }
  cur.clear();
  for (int i = 1; i <= min(n, 10); i++) {
    for (int j = i + 2; j <= min(n, 10); j += 2) {
      cur.push_back((opt){i, (i + j) >> 1, j});
    }
  }
  int siz = cur.size();
  vector<int> order;
  for (int i = 0; i < (1 << siz); i++) order.push_back(i);
  for (int i = 1; i < (1 << siz); i++) popcnt[i] = popcnt[i >> 1] + (i & 1);
  sort(order.begin(), order.end(), cmp);
  for (int &x : order) {
    for (int i = 0; i < siz; i++)
      if ((x >> i) & 1) apply(cur[i]);
    bool flag = 1;
    for (int i = 1; i <= min(n, 10); i++) {
      if (a[i]) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      puts("YES");
      printf("%d\n", ans.size() + popcnt[x]);
      for (auto &y : ans) printf("%d %d %d\n", y.a, y.b, y.c);
      for (int i = 0; i < siz; i++)
        if ((x >> i) & 1) printf("%d %d %d\n", cur[i].a, cur[i].b, cur[i].c);
      return 0;
    }
    for (int i = 0; i < siz; i++)
      if ((x >> i) & 1) apply(cur[i]);
  }
  puts("NO");
  return 0;
}
