#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int t[MAXN];
vector<tuple<int, int, int>> v;
bool nope = 0;
void put(int a, int b, int c) {
  assert(b - a == c - b);
  if (a < 1) {
    nope = 1;
    return;
  }
  v.push_back({a, b, c});
  t[a] ^= 1;
  t[b] ^= 1;
  t[c] ^= 1;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
  }
  for (int i = 1; i <= n - 2; i += 3) {
    if (n - i + 1 <= 17) {
      if (t[i] == 1) put(i, i + 1, i + 2);
      i -= 2;
      continue;
    }
    if (make_tuple(t[i], t[i + 1], t[i + 2]) == make_tuple(1, 1, 1))
      put(i, i + 1, i + 2);
    else if (make_tuple(t[i], t[i + 1], t[i + 2]) == make_tuple(0, 1, 1))
      put(i + 1, i + 2, i + 3);
    else if (make_tuple(t[i], t[i + 1], t[i + 2]) == make_tuple(1, 0, 1))
      put(i, i + 2, i + 4);
    else if (make_tuple(t[i], t[i + 1], t[i + 2]) == make_tuple(1, 1, 0)) {
      if (make_tuple(t[i + 3], t[i + 4], t[i + 5]) == make_tuple(0, 0, 0)) {
        put(i, i + 1, i + 2);
        put(i + 2, i + 6, i + 10);
        continue;
      }
      if (t[i + 3] + t[i + 4] + t[i + 5] == 1) {
        int a;
        for (int j = 0; j < 3; j++) {
          if (t[i + 3 + j] == 1) {
            a = i + 3 + j;
            break;
          }
        }
        put(i, a, a + (a - i));
        put(i + 1, i + 6, i + 11);
        continue;
      }
      if (t[i + 3] + t[i + 4] + t[i + 5] == 2) {
        int a, b;
        for (int j = 0; j < 3; j++) {
          if (t[i + 3 + j] == 1) {
            a = i + 3 + j;
            break;
          }
        }
        for (int j = 0; j < 3; j++) {
          if (t[i + 3 + j] == 1) {
            b = i + 3 + j;
          }
        }
        put(i, a, a + (a - i));
        put(i + 1, b, b + (b - i - 1));
        continue;
      }
      if (t[i + 6] + t[i + 7] + t[i + 8] == 3) {
        put(i, i + 3, i + 6);
        put(i + 1, i + 4, i + 7);
        put(i + 5, i + 8, i + 11);
        continue;
      }
      put(i + 3, i + 4, i + 5);
      if (t[i + 6] + t[i + 7] + t[i + 8] == 1) {
        int a;
        for (int j = 0; j < 3; j++) {
          if (t[i + 6 + j] == 1) {
            a = i + 6 + j;
            break;
          }
        }
        put(i, a, a + (a - i));
        put(i + 1, i + 9, i + 17);
        continue;
      }
      if (t[i + 6] + t[i + 7] + t[i + 8] == 2) {
        int a, b;
        for (int j = 0; j < 3; j++) {
          if (t[i + 6 + j] == 1) {
            a = i + 6 + j;
            break;
          }
        }
        for (int j = 0; j < 3; j++) {
          if (t[i + 6 + j] == 1) {
            b = i + 6 + j;
          }
        }
        put(i, a, a + (a - i));
        put(i + 1, b, b + (b - i - 1));
        continue;
      }
      if (t[i + 6] + t[i + 7] + t[i + 8] == 0) {
        put(i, i + 4, i + 8);
        put(i + 1, i + 5, i + 9);
        put(i + 3, i + 8, i + 13);
        continue;
      }
      assert(0);
    } else {
      for (int j = 0; j < 3; j++) {
        if (t[i + j]) put(i + j, i + j + 3, i + j + 6);
      }
    }
  }
  if (t[n - 2] + t[n - 1] + t[n] == 1) {
    int a;
    for (int i = n - 2; i <= n; i++) {
      if (t[i] == 1) a = i;
    }
    put(a - 6, a - 3, a);
    put(a - 5, a - 4, a - 3);
    put(a - 6, a - 5, a - 4);
  } else if (t[n - 2] + t[n - 1] + t[n] == 2) {
    put(n - 6, n - 3, n);
    put(n - 7, n - 4, n - 1);
    put(n - 7, n - 6, n - 5);
    put(n - 5, n - 4, n - 3);
  }
  if (t[n - 2] != 0 || t[n - 1] != 0 || t[n] != 0 || nope) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  printf("%d\n", (int)v.size());
  for (auto p : v) {
    printf("%d %d %d\n", get<0>(p), get<1>(p), get<2>(p));
  }
  for (int i = 1; i <= n; i++) {
    fprintf(stderr, "%d ", t[i]);
  }
  fprintf(stderr, "\n");
  return 0;
}
