#include <bits/stdc++.h>
using namespace std;
const int N = 111111, NN = 15;
int dist[NN][1 << NN], pr[NN][1 << NN];
pair<int, int> op[NN][1 << NN];
int q[N], a[N];
int qs, qe;
int f(int v, int p, int x, int n) {
  assert(p + 2 * x <= n);
  for (int i = (0); i <= (2); i++) {
    int pos = p + i * x;
    v ^= 1 << (pos - 1);
  }
  return v;
}
void bfs(int n) {
  if (dist[n][0] == 0) return;
  dist[n][0] = 0;
  q[qs++] = 0;
  while (qs != qe) {
    int u = q[qe++];
    qe %= N;
    for (int p = (1); p <= (n); p++) {
      for (int x = (1); x <= (n); x++) {
        if (p + 2 * x <= n) {
          int v = f(u, p, x, n);
          if (dist[n][u] + 1 < dist[n][v]) {
            dist[n][v] = dist[n][u] + 1;
            pr[n][v] = u;
            op[n][v] = make_pair(p, x);
            q[qs++] = v;
            qs %= N;
          }
        }
      }
    }
  }
}
vector<pair<int, int> > get(int n, int v) {
  vector<pair<int, int> > ans;
  if (dist[n][v] > 1e6) {
    return ans;
  }
  while (v) {
    ans.push_back(op[n][v]);
    v = pr[n][v];
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = (3); i <= (NN - 1); i++) {
    fill(dist[i], dist[i] + (1 << i), 1e7);
    bfs(i);
  }
  int n;
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    cin >> a[i];
  }
  vector<int> di;
  vector<pair<int, int> > ans;
  int pos = 1;
  while (pos <= n) {
    int rem = n - pos + 1;
    int cur = NN - 1, add = 0;
    if (cur >= rem) {
      cur = rem;
    } else {
      cur = 6;
      add = 6;
    }
    int v = 0;
    for (int i = (1); i <= (cur); i++) {
      v = v * 2 + a[pos + cur - i];
    }
    vector<pair<int, int> > ops;
    if (add) {
      int mini = 10, bv, bm;
      for (int mask = (0); mask <= ((1 << add) - 1); mask++) {
        int vv = v + mask * (1 << cur);
        int di = dist[cur + add][vv];
        if (di < mini) {
          mini = di;
          bv = vv;
          bm = mask;
        }
      }
      ops = get(cur + add, bv);
      for (int i = (0); i <= (add - 1); i++) {
        a[pos + cur + i] ^= (bm & (1 << i)) > 0;
      }
    } else {
      if (dist[cur][v] > 1e6) {
        cout << "NO" << endl;
        return 0;
      }
      ops = get(cur, v);
    }
    for (auto p : ops) {
      ans.push_back(make_pair(p.first + pos - 1, p.second));
    }
    pos += cur;
  }
  cout << "YES" << endl;
  cout << (int)(ans).size() << endl;
  for (auto p : ans) {
    for (int i = (0); i <= (2); i++) {
      cout << p.first + i * p.second << " ";
    }
    cout << endl;
  }
  return 0;
}
