#include <bits/stdc++.h>
using namespace std;
struct trip {
  int x, y, z;
};
int n;
int a[200001];
vector<trip> Ans;
void GG() {
  printf("NO\n");
  exit(0);
}
void Do(int x, int y, int z) {
  a[x] ^= 1;
  a[y] ^= 1;
  a[z] ^= 1;
  Ans.push_back((trip){x, y, z});
}
int flip(int x, int y) { return 2 * y - x; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i)
    if (a[i] == 1) {
      int j;
      for (j = i + 1; j <= n && a[j] != 1; ++j)
        ;
      if (j > n) {
        while (i < 7 && i + 3 <= n) {
          Do(i, i + 1, i + 2);
          Do(i + 1, i + 2, i + 3);
          i += 3;
        }
        if (i >= 7) {
          Do(i - 6, i - 3, i);
          Do(i - 6, i - 5, i - 4);
          Do(i - 5, i - 4, i - 3);
          break;
        } else if (n >= 8) {
          Do(i, i + 1, i + 2);
          continue;
        } else
          GG();
      }
      bool flag = 0;
      if (j == i + 1) {
        if (j == n) {
          if (n >= 9) {
            Do(n - 2, n - 1, n);
            i = n - 3;
            flag = 1;
          } else if (n < 8)
            GG();
          else {
            Do(n, n - 3, n - 6);
            Do(n - 6, n - 5, n - 4);
            Do(n - 5, n - 4, n - 3);
            i = n - 2;
            flag = 1;
          }
        }
        if (a[j + 1] == 1) {
          Do(i, j, j + 1);
          flag = 1;
        } else {
          if (j + 4 <= n && a[j + 2] == 1) {
            Do(j, j + 2, j + 4);
            flag = 1;
            --i;
          }
        }
      }
      if (!flag) {
        int k = flip(i, j);
        if (k <= n)
          Do(i, j, k);
        else {
          int x = (i + j) / 2;
          Do(i, x, flip(i, x));
        }
      }
    }
  for (int i = 1; i <= n; ++i) assert(a[i] == 0);
  printf("YES\n");
  printf("%d\n", (int)Ans.size());
  for (auto x : Ans) printf("%d %d %d\n", x.x, x.y, x.z);
  return 0;
}
