#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
struct Tri {
  int x, y, z;
} pret[N];
int diss[N], pre[N], g[N], gs[N], q[N];
bool vis[N];
vector<Tri> gg[N];
void prepare() {
  for (int s = 1; s <= (1 << 6) - 1; s++) {
    int he = 0, ta = 0;
    memset(diss, 0, sizeof(diss));
    memset(pre, 0, sizeof(pre));
    memset(vis, false, sizeof(vis));
    q[++ta] = s, vis[s] = true;
    while (he != ta) {
      int x = q[++he];
      if (!x) break;
      for (int i = 0; i <= 5; i++)
        for (int j = i + 1; j <= 5; j++) {
          int k = j + j - i;
          if (k <= 5) {
            int tmp = x ^ (1 << i) ^ (1 << j) ^ (1 << k);
            if (!vis[tmp]) {
              vis[tmp] = true, q[++ta] = tmp, diss[tmp] = diss[x], pre[tmp] = x,
              pret[tmp] = (Tri){i, j, k};
            }
          } else {
            int tmp = x ^ (1 << i) ^ (1 << j);
            if (!vis[tmp]) {
              vis[tmp] = true, q[++ta] = tmp,
              diss[tmp] = diss[x] ^ (1 << (k - 6)), pre[tmp] = x,
              pret[tmp] = (Tri){i, j, k};
            }
          }
        }
      for (int i = 1; i <= 5; i++) {
        int j = 6, k = j + j - i, tmp = x ^ (1 << i);
        if (!vis[tmp]) {
          vis[tmp] = true, q[++ta] = tmp,
          diss[tmp] = diss[x] ^ 1 ^ (1 << (k - 6)), pre[tmp] = x,
          pret[tmp] = (Tri){i, j, k};
        }
      }
    }
    for (int i = 0; i != s; i = pre[i]) {
      gg[s].push_back(pret[i]);
    }
    gs[s] = diss[0];
  }
}
int a[N], cnt;
Tri ans[N];
int main() {
  prepare();
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ll = 1;
  while (n - (ll + 6) + 1 >= 9) {
    int s = 0;
    for (int i = 0; i <= 5; i++) s |= (a[ll + i] << i);
    if (s)
      for (int i = gg[s].size() - 1; i >= 0; i--)
        ans[++cnt] = (Tri){gg[s][i].x + ll, gg[s][i].y + ll, gg[s][i].z + ll};
    ll += 6;
    for (int i = 0; i <= 5; i++)
      if (gs[s] & (1 << i)) a[ll + i] ^= 1;
  }
  int ss = 0;
  for (int i = ll; i <= n; i++) ss += (a[i] << (i - ll));
  int he = 0, ta = 0;
  memset(diss, 0, sizeof(diss));
  memset(pre, 0, sizeof(pre));
  memset(vis, false, sizeof(vis));
  q[++ta] = ss, vis[ss] = true;
  while (he != ta) {
    int x = q[++he];
    if (!x) break;
    for (int i = 0; i <= n - ll; i++)
      for (int j = i + 1; j <= n - ll; j++) {
        int k = j + j - i;
        if (k <= n - ll) {
          int tmp = x ^ (1 << i) ^ (1 << j) ^ (1 << k);
          if (!vis[tmp]) {
            vis[tmp] = true, q[++ta] = tmp, diss[tmp] = diss[x], pre[tmp] = x,
            pret[tmp] = (Tri){i, j, k};
          }
        }
      }
  }
  if (!vis[0])
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i != ss; i = pre[i]) gg[0].push_back(pret[i]);
    if (gg[0].size())
      for (int i = gg[0].size() - 1; i >= 0; i--)
        ans[++cnt] = (Tri){gg[0][i].x + ll, gg[0][i].y + ll, gg[0][i].z + ll};
    printf("%d\n", cnt);
    for (int i = 1; i <= cnt; i++)
      printf("%d %d %d\n", ans[i].x, ans[i].y, ans[i].z);
  }
  return 0;
}
