#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 100000;
struct Op {
  int a, b, c;
  Op() {}
  Op(int a, int b, int c) : a(a), b(b), c(c) {}
};
int n;
char s[MAXN + 1];
vector<Op> ans;
void flip(int a) {
  if (s[a] == '0')
    s[a] = '1';
  else
    s[a] = '0';
}
void flip(int a, int b, int c) {
  ans.push_back(Op(a, b, c));
  flip(a);
  flip(b);
  flip(c);
}
int dp[2][1 << 18];
Op act[2][1 << 18];
int q[1 << 18], qhead, qtail;
void precalc() {
  for (int kind = (0); kind < (2); ++kind) {
    int len = kind == 0 ? min(n, n % 6 + 12) : 12;
    for (int i = (0); i < (1 << len); ++i) dp[kind][i] = INT_MAX;
    qhead = qtail = 0;
    if (kind == 0) {
      dp[kind][0] = 0, q[qhead++] = 0;
    } else {
      for (int i = (0); i < (1 << 6); ++i) dp[kind][i] = 0, q[qhead++] = i;
    }
    while (qtail < qhead) {
      int at = q[qtail++];
      for (int i = (0); i < (len); ++i)
        for (int j = (i + 1); j < (len); ++j) {
          int k = j + (j - i);
          if (k >= len) break;
          int to = at ^ (1 << i) ^ (1 << j) ^ (1 << k);
          if (dp[kind][to] != INT_MAX) continue;
          dp[kind][to] = dp[kind][at] + 1, act[kind][to] = Op(i, j, k),
          q[qhead++] = to;
        }
    }
  }
}
bool solve() {
  ans.clear();
  int rem = n, last = min(n, n % 6 + 12);
  while (rem > last) {
    int at = 0, off = rem - 12;
    for (int i = (0); i < (12); ++i)
      if (s[off + i] == '1') at |= 1 << i;
    while (dp[1][at] != 0) {
      Op cur = act[1][at];
      flip(off + cur.a, off + cur.b, off + cur.c);
      at ^= (1 << cur.a) ^ (1 << cur.b) ^ (1 << cur.c);
    }
    rem -= 6;
  }
  {
    int at = 0;
    for (int i = (0); i < (rem); ++i)
      if (s[i] == '1') at |= 1 << i;
    while (dp[0][at] != 0) {
      if (dp[0][at] == INT_MAX) return false;
      Op cur = act[0][at];
      flip(cur.a, cur.b, cur.c);
      at ^= (1 << cur.a) ^ (1 << cur.b) ^ (1 << cur.c);
    }
  }
  return true;
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf(" %c", &s[i]);
  s[n] = '\0';
  precalc();
  if (!solve()) {
    printf("NO\n");
    return;
  }
  printf("YES\n");
  printf("%d\n", ((int)(ans).size()));
  for (int i = (0); i < (((int)(ans).size())); ++i)
    printf("%d %d %d\n", ans[i].a + 1, ans[i].b + 1, ans[i].c + 1);
}
char orig[MAXN + 1];
void research() {
  for (int len = (3); len <= (25); ++len) {
    n = len;
    printf("%d:\n", len);
    precalc();
    for (int mask = (0); mask < (1 << len); ++mask) {
      for (int i = (0); i < (len); ++i)
        orig[i] = s[i] = '0' + ((mask >> i) & 1);
      orig[len] = s[len] = '\0';
      bool res = solve();
      if (res)
        for (int i = (0); i < (len); ++i) assert(s[i] == '0');
      if (res) assert(((int)(ans).size()) <= len / 3 + 12);
      if (!res) printf("%d\n", len);
    }
  }
}
void stress() {
  for (int rep = (0); rep < (1000); ++rep) {
    n = MAXN;
    for (int i = (0); i < (n); ++i) s[i] = '0' + rand() % 2;
    s[n] = '\0';
    precalc();
    bool res = solve();
    assert(res);
    assert(((int)(ans).size()) <= n / 3 + 12);
    printf(".");
  }
}
int main() {
  run();
  return 0;
}
