#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, ans;
int A[N];
struct Op {
  int a, b, c;
} op[N];
void flip(int b, int c) {
  int a = 2 * b - c;
  assert(a > 0), assert(b < c);
  op[++ans] = (Op){a, b, c};
  A[a] ^= 1, A[b] ^= 1, A[c] ^= 1;
}
int dis[1 << 12], pre[1 << 12];
Op dmz[1 << 12];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  bool flag = n > 12;
  while (n > 12) {
    if (!A[n]) {
      --n;
      continue;
    }
    if (A[n - 1] && A[n - 2])
      flip(n - 1, n), n -= 3;
    else if (!A[n - 1] && !A[n - 2])
      flip(n - 3, n), n -= 3;
    else if (!A[n - 1] && A[n - 2])
      flip(n - 2, n), n -= 3;
    else {
      int c = 0, p[3];
      for (int i = n - 5; i <= n - 3; i++)
        if (A[i]) p[c++] = i;
      if (!c)
        flip(n - 1, n), flip(n - 6, n - 2);
      else if (c == 1)
        flip(p[0], n), flip(n - 6, n - 1);
      else if (c == 2)
        flip(p[0], n - 1), flip(p[1], n);
      else
        flip(n - 3, n - 1), flip(n - 4, n);
      n -= 6;
    }
  }
  if (flag) n = 12;
  memset(dis, -1, sizeof dis);
  int st = 0;
  for (int i = 1; i <= n; i++) st |= A[i] << (i - 1);
  dis[st] = 0;
  queue<int> q;
  q.push(st);
  while (!q.empty()) {
    int o = q.front();
    q.pop();
    for (int b = 1; b <= n - 2; b++) {
      int r = min(b, n - 1 - b);
      for (int d = 1; d <= r; d++) {
        int v = o ^ (1 << (b)) ^ (1 << (b - d)) ^ (1 << (b + d));
        if (dis[v] >= 0) continue;
        dis[v] = dis[o] + 1, pre[v] = o,
        dmz[v] = (Op){b - d + 1, b + 1, b + d + 1};
        q.push(v);
      }
    }
  }
  if (dis[0] < 0) {
    puts("NO");
    return 0;
  }
  int o = 0;
  while (o != st) op[++ans] = dmz[o], o = pre[o];
  printf("YES\n%d\n", ans);
  for (int i = 1; i <= ans; i++)
    printf("%d %d %d\n", op[i].a, op[i].b, op[i].c);
  return 0;
}
