#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
vector<int> a(N);
vector<tuple<int, int, int> > v, tb[70];
void flip(vector<int>& ve, tuple<int, int, int>& op) {
  ve[get<0>(op)] ^= 1;
  ve[get<1>(op)] ^= 1;
  ve[get<2>(op)] ^= 1;
}
void pre() {
  vector<tuple<int, int, int> > op;
  for (int i = 1; i * 2 < 11; i++) {
    for (int j = 0; j + i * 2 < 11; j++) {
      op.push_back(tuple<int, int, int>(j, j + i, j + i * 2));
    }
  }
  vector<int> r(11, 0);
  auto cal = [&r]() {
    int res = 0;
    for (int i = 5; i < 11; i++) res = res * 2 + r[i];
    return res;
  };
  for (auto it = op.begin(); it != op.end(); it++) {
    flip(r, *it);
    int x = cal();
    if (x && tb[x].empty()) tb[x].push_back(*it);
    for (auto it2 = next(it); it2 != op.end(); it2++) {
      flip(r, *it2);
      int y = cal();
      if (y && tb[y].empty()) tb[y].push_back(*it), tb[y].push_back(*it2);
      flip(r, *it2);
    }
    flip(r, *it);
  }
}
bool bf() {
  vector<tuple<int, int, int> > op;
  for (int i = 1; i * 2 < n; i++) {
    for (int j = 1; j + i * 2 <= n; j++) {
      op.push_back(tuple<int, int, int>(j, j + i, j + i * 2));
    }
  }
  vector<int> r(a.begin(), a.begin() + n + 1);
  int s = op.size();
  for (int i = 0; i < (1 << s); i++) {
    vector<int> ve(n + 1, 0);
    for (int j = 0; j < s; j++) {
      if (1 & (i >> j)) flip(ve, op[j]);
    }
    if (ve == r) {
      puts("YES");
      printf("%d\n", __builtin_popcount(i) + v.size());
      for (int j = 0; j < s; j++) {
        if (1 & (i >> j)) {
          printf("%d %d %d\n", get<0>(op[j]), get<1>(op[j]), get<2>(op[j]));
        }
      }
      return 1;
    }
  }
  puts("NO");
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  if (n < 11)
    bf();
  else {
    pre();
    for (; n > 10; n -= 6) {
      int mask = 0;
      for (int i = n - 5; i <= n; i++) mask = mask * 2 + a[i];
      for (tuple<int, int, int> i : tb[mask]) {
        tuple<int, int, int> tmp = tuple<int, int, int>(
            get<0>(i) + n - 10, get<1>(i) + n - 10, get<2>(i) + n - 10);
        v.push_back(tmp);
        flip(a, tmp);
      }
    }
    n = 10;
    if (bf()) {
      for (int i = 0; i < (int)v.size(); i++) {
        printf("%d %d %d\n", get<0>(v[i]), get<1>(v[i]), get<2>(v[i]));
      }
    }
  }
  return 0;
}
