#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, l0;
  vector<int> x, l;
  scanf("%d", &n);
  int *a = new int[n + 1];
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= n - 2; i++) {
    if (a[i] == 1) {
      l0 = 1;
      for (int j = 2; j <= (n - i) / 2; ++j) {
        if (a[i + j] == 1) {
          l0 = j;
          break;
        }
      }
      a[i] ^= 1;
      a[i + l0] ^= 1;
      a[i + l0 + l0] ^= 1;
      x.push_back(i);
      l.push_back(l0);
    }
  }
  if (a[n] == 1 && a[n - 1] == 0) {
    if (n > 6) {
      x.push_back(n - 6);
      l.push_back(3);
      x.push_back(n - 6);
      l.push_back(1);
      x.push_back(n - 5);
      l.push_back(1);
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (a[n] == 0 && a[n - 1] == 1) {
    if (n > 7) {
      x.push_back(n - 7);
      l.push_back(3);
      x.push_back(n - 7);
      l.push_back(1);
      x.push_back(n - 6);
      l.push_back(1);
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (a[n] == 1 && a[n - 1] == 1) {
    if (n > 7) {
      x.push_back(n - 7);
      l.push_back(3);
      x.push_back(n - 7);
      l.push_back(1);
      x.push_back(n - 6);
      l.push_back(1);
      x.push_back(n - 6);
      l.push_back(3);
      x.push_back(n - 6);
      l.push_back(1);
      x.push_back(n - 5);
      l.push_back(1);
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  printf("YES\n%d\n", x.size());
  for (int i = 0; i < x.size(); ++i) {
    printf("%d %d %d\n", x[i], x[i] + l[i], x[i] + l[i] + l[i]);
  }
  return 0;
}
