#include <bits/stdc++.h>
using namespace std;
int n, a[100001], b[100001];
vector<tuple<int, int, int> > res;
int bitc(int k) {
  int ret = 0;
  while (k) {
    ret += k % 2;
    k /= 2;
  }
  return ret;
}
bool brute(int l, int r) {
  vector<tuple<int, int, int> > tar;
  for (int d = 1; l + 2 * d <= r; d++) {
    for (int i = l; i + 2 * d <= r; i++) {
      tar.push_back(tuple<int, int, int>(i, i + d, i + 2 * d));
    }
  }
  int minc = (1 << 30), to = -1;
  for (int i = 0; i < (1 << tar.size()); i++) {
    for (int j = l; j <= r; j++) b[j] = a[j];
    for (int j = 0; j < tar.size(); j++)
      if (i & (1 << j)) {
        int t1 = get<0>(tar[j]), t2 = get<1>(tar[j]), t3 = get<2>(tar[j]);
        b[t1] ^= 1;
        b[t2] ^= 1;
        b[t3] ^= 1;
      }
    bool ok = true;
    for (int j = l; j <= r; j++) {
      if (b[j]) {
        ok = false;
        break;
      }
    }
    if (ok) {
      int p = bitc(i);
      if (p < minc) {
        minc = p;
        to = i;
      }
    }
  }
  if (to < 0) return false;
  for (int i = 0; i < tar.size(); i++)
    if (to & (1 << i)) res.push_back(tar[i]);
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (n < 8) {
    if (!brute(1, n)) {
      puts("NO");
      return 0;
    } else {
      puts("YES");
      printf("%d\n", (int)res.size());
      for (int i = 0; i < res.size(); i++)
        printf("%d %d %d\n", get<0>(res[i]), get<1>(res[i]), get<2>(res[i]));
      return 0;
    }
  }
  for (int i = 1; i <= n - 8; i++) {
    if (a[i]) {
      bool found = false;
      for (int j = i + 1; 2 * j - i <= n - 8; j++) {
        if (a[j]) {
          found = true;
          a[i] ^= 1;
          a[j] ^= 1;
          a[2 * j - i] ^= 1;
          res.push_back(tuple<int, int, int>(i, j, 2 * j - i));
          break;
        }
      }
      if (!found) {
        a[i] ^= 1;
        a[i + 1] ^= 1;
        a[i + 2] ^= 1;
        res.push_back(tuple<int, int, int>(i, i + 1, i + 2));
      }
    }
  }
  brute(n - 7, n);
  puts("YES");
  printf("%d\n", (int)res.size());
  for (int i = 0; i < res.size(); i++)
    printf("%d %d %d\n", get<0>(res[i]), get<1>(res[i]), get<2>(res[i]));
  return 0;
}
