#include <bits/stdc++.h>
using namespace std;
template <class _Tp>
_Tp gcd(_Tp a, _Tp b) {
  return (b == 0) ? (a) : (gcd(b, a % b));
}
const long long Inf = 1000000000000000000ll;
const int inf = 1000000000;
char buf[1 << 25], *p1 = buf, *p2 = buf;
inline int getc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 25, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  int x = 0, f = 0;
  char c = getc();
  while (!isdigit(c)) (c == '-') && (f = 1), c = getc();
  while (isdigit(c)) x = x * 10 + (c & 15), c = getc();
  return f ? -x : x;
}
const int N = 100005;
vector<pair<int, int> > ans;
int n, a[N];
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 1, len; i <= n - 2; ++i) {
    if (!a[i]) continue;
    len = 1;
    for (int j = 2; j + j <= n - i; ++j)
      if (a[i + j]) {
        len = j;
        break;
      }
    a[i] ^= 1;
    a[i + len] ^= 1;
    a[i + len + len] ^= 1;
    ans.emplace_back(i, len);
  }
  for (int i = n - 1; i <= n; ++i) {
    if (!a[i]) continue;
    if (i <= 6) {
      puts("NO");
      return 0;
    }
    ans.emplace_back(i - 6, 1);
    ans.emplace_back(i - 5, 1);
    ans.emplace_back(i - 6, 3);
  }
  puts("YES");
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i)
    printf("%d %d %d\n", ans[i].first, ans[i].first + ans[i].second,
           ans[i].first + ans[i].second + ans[i].second);
  return 0;
}
