#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, a[N];
vector<pair<int, int> > ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n - 2; ++i)
    if (a[i]) {
      int k = 1;
      for (int j = 2; j <= (n - i) / 2; ++j)
        if (a[i + j]) {
          k = j;
          break;
        }
      a[i] ^= 1;
      a[i + k] ^= 1;
      a[i + k + k] ^= 1;
      ans.emplace_back(i, k);
    }
  for (int i = n - 1; i <= n; ++i)
    if (a[i]) {
      if (i <= 6) {
        cout << "NO\n";
        return 0;
      }
      ans.emplace_back(i - 6, 1);
      ans.emplace_back(i - 6, 3);
      ans.emplace_back(i - 5, 1);
    }
  cout << "YES\n" << ans.size() << '\n';
  for (auto i : ans)
    cout << i.first << ' ' << i.first + i.second << ' '
         << i.first + i.second + i.second << '\n';
  return 0;
}
