#include <bits/stdc++.h>
bool a[100001];
class op {
  int first, delta;

 public:
  inline op(int first, int delta) : first(first), delta(delta) {
    a[first] ^= 1, a[first + delta] ^= 1, a[first + (delta << 1)] ^= 1;
  }
  friend inline std::ostream& operator<<(std::ostream& LHS, const op& RHS) {
    std::cout << RHS.first << ' ' << RHS.first + RHS.delta << ' '
              << RHS.first + (RHS.delta << 1);
    return LHS;
  }
};
std::vector<op> flip;
int main() {
  std::ios_base::sync_with_stdio(0), std::cin.tie(0);
  int n;
  std::cin >> n;
  for (int i = 1; i <= n; ++i) std::cin >> a[i];
  for (int i = 1; i + 2 <= n; ++i)
    if (a[i])
      if (i + 10 < n)
        if (a[i + 1])
          if (a[i + 2])
            flip.emplace_back(i, 1);
          else if (a[i + 3])
            if (a[i + 4])
              flip.emplace_back(i, 4);
            else
              flip.emplace_back(i, 3);
          else if (a[i + 4])
            flip.emplace_back(i, 4);
          else
            flip.emplace_back(i, 5);
        else if (a[i + 2])
          flip.emplace_back(i, 2);
        else
          flip.emplace_back(i, 3);
      else
        flip.emplace_back(i, 1);
  if (a[n - 1])
    if (a[n])
      if (n >= 8)
        flip.emplace_back(n - 7, 2), flip.emplace_back(n - 7, 3),
            flip.emplace_back(n - 6, 1), flip.emplace_back(n - 6, 3);
      else {
        std::cout << "NO\n";
        return 0;
      }
    else if (n >= 8)
      flip.emplace_back(n - 5, 1), flip.emplace_back(n - 7, 2),
          flip.emplace_back(n - 7, 3);
    else {
      std::cout << "NO\n";
      return 0;
    }
  else if (a[n])
    if (n >= 7)
      flip.emplace_back(n - 4, 1), flip.emplace_back(n - 6, 2),
          flip.emplace_back(n - 6, 3);
    else {
      std::cout << "NO\n";
      return 0;
    }
  std::cout << "YES\n" << flip.size() << '\n';
  for (const op& i : flip) std::cout << i << '\n';
}
