#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-9;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 60;
const int mods = 1e9 + 7;
const int inv2 = (mods + 1) >> 1;
const int MAXN = 100005;
const int INF = 0x3f3f3f3f;
namespace FastIO {
constexpr int SIZE = (1 << 21) + 1;
int num = 0, f;
char ibuf[SIZE], obuf[SIZE], que[65], *iS, *iT, *oS = obuf,
                                                *oT = obuf + SIZE - 1, c;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char c) {
  *oS++ = c;
  if (oS == oT) flush();
}
inline void getc(char &c) {
  for (c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       !isalpha(c) && c != EOF;
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    ;
}
inline void reads(char *st) {
  char c;
  int n = 0;
  getc(st[++n]);
  for (c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       isalpha(c);
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    st[++n] = c;
  st[n + 1] = '\0';
}
template <class I>
inline void read(I &x) {
  for (f = 1, c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-') f = -1;
  for (x = 0; c >= '0' && c <= '9';
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = (x << 3) + (x << 1) + (c & 15);
  x *= f;
}
template <class I>
inline void print(I x) {
  if (x < 0) putc('-'), x = -x;
  if (!x) putc('0');
  while (x) que[++num] = x % 10 + 48, x /= 10;
  while (num) putc(que[num--]);
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_Flusher_;
}  // namespace FastIO
using FastIO ::print;
using FastIO ::putc;
using FastIO ::read;
using FastIO ::reads;
pair<int, int> frm[MAXN];
vector<pair<int, int> > Ans;
int vis[MAXN], a[MAXN], n;
queue<int> que;
void bfs(int x, int n) {
  for (int i = 0; i < 1 << n; ++i) vis[i] = INF, frm[i] = make_pair(0, 0);
  vis[x] = 0, que.push(x);
  while (!que.empty()) {
    int q = que.front();
    que.pop();
    for (int i = 1; i < n - 1; ++i)
      for (int j = 1; j <= i && j <= n - i - 1; ++j) {
        int t = q ^ (1 << i) ^ (1 << (i - j)) ^ (1 << (i + j));
        if (vis[t] != INF) continue;
        vis[t] = vis[q] + 1, frm[t] = make_pair(i, j), que.push(t);
      }
  }
}
signed main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  if (n > 8) {
    bfs(0, 14);
    for (int j = n; j - 6 >= 8; j -= 6) {
      int t = (a[j - 5] << 8) | (a[j - 4] << 9) | (a[j - 3] << 10) |
              (a[j - 2] << 11) | (a[j - 1] << 12) | (a[j] << 13),
          mn = t;
      for (int k = 0; k < 1 << 8; ++k)
        if (vis[t | k] < vis[mn]) mn = t | k;
      t = mn;
      int Num = 0;
      while (t) {
        ++Num;
        pair<int, int> p = make_pair(frm[t].first + j - 13, frm[t].second);
        Ans.push_back(p);
        a[p.first] ^= 1, a[p.first - p.second] ^= 1, a[p.first + p.second] ^= 1;
        t = t ^ (1 << frm[t].first) ^ (1 << (frm[t].first - frm[t].second)) ^
            (1 << (frm[t].first + frm[t].second));
      }
    }
    n = (n - 8) % 6 + 8;
  }
  int t = 0;
  for (int i = n; i >= 1; --i) t = (t << 1) | a[i];
  bfs(t, n);
  if (vis[0] == INF) {
    putc('N'), putc('O'), putc('\n');
    return 0;
  };
  putc('Y'), putc('E'), putc('S'), putc('\n');
  int nw = 0;
  while (frm[nw].second) {
    Ans.push_back(make_pair(frm[nw].first + 1, frm[nw].second));
    nw = nw ^ (1 << frm[nw].first) ^ (1 << (frm[nw].first - frm[nw].second)) ^
         (1 << (frm[nw].first + frm[nw].second));
  }
  print(Ans.size()), putc('\n');
  for (auto v : Ans)
    print(v.first - v.second), putc(' '), print(v.first), putc(' '),
        print(v.first + v.second), putc('\n');
  return 0;
}
