func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > sol[1 << 9];   vector<pair<int, int> > gs(int t, int x) {     static int fm[1 << 19];     static pair<int, int> fs[1 << 19];     queue<int> q;     vector<pair<pair<int, int>, int> > sb;     for (int i = 0; i < (1 << t); ++i) fm[i] = -1;     for (int i = 0; i < t; ++i)       for (int k = 1; i + k + k < t; ++k)         sb.push_back(make_pair(pair<int, int>(i, k),                                (1 << i) ^ (1 << (i + k)) ^ (1 << (i + k + k))));     q.push(x);     fm[x] = -2;     while (!q.empty()) {       int w = q.front();       q.pop();       for (auto p : sb) {         if (fm[w ^ p.second] != -1) continue;         fm[w ^ p.second] = w;         fs[w ^ p.second] = p.first;         q.push(w ^ p.second);       }     }     if (fm[0] == -1) throw  GG ;     int tt = 0;     vector<pair<int, int> > vp;     while (tt != x) vp.push_back(fs[tt]), tt = fm[tt];     return vp;   }   int n;   int a[233333];   int main() {     int mx = 0;     for (int i = 0; i < (1 << 9); ++i) {       vector<pair<int, int> > sb;       for (int j = 0; j < 12; ++j)         for (int k = 1; j + k + k < 12; ++k) sb.push_back(pair<int, int>(j, k));       random_shuffle(sb.begin(), sb.end());       int u = sb.size();       for (int x = -1; x < u; ++x)         for (int y = x; y < u; ++y)           for (int z = y; z < u; ++z) {             vector<pair<int, int> > p;             if (x >= 0) p.push_back(sb[x]);             if (y >= 0) p.push_back(sb[y]);             if (z >= 0) p.push_back(sb[z]);             int w = i;             for (auto h : p) {               int a = h.first, b = h.second;               if (a >= 0 && a < 9) w ^= 1 << a;               if (a + b >= 0 && a + b < 9) w ^= 1 << (a + b);               if (a + b + b >= 0 && a + b + b < 9) w ^= 1 << (a + b + b);             }             if (!w) {               sol[i] = p;               goto GG;             }           }       cout <<  NMSL. n ;     GG:;     }     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %d , a + i);     vector<pair<pair<int, int>, int> > vp;     int l = 1;     while (n - l + 1 >= 18) {       int h = 0;       for (int p = 0; p < 9; ++p)         if (a[l + p]) h ^= 1 << p;       vector<pair<int, int> > w = sol[h];       for (auto& t : w) {         t.first += l;         vp.push_back(make_pair(make_pair(t.first, t.first + t.second),                                t.first + t.second + t.second));         a[t.first] ^= 1;         a[t.first + t.second] ^= 1;         a[t.first + t.second + t.second] ^= 1;       }       l += 9;     }     try {       int g = 0;       for (int i = l; i <= n; ++i)         if (a[i]) g ^= 1 << (i - l);       vector<pair<int, int> > w = gs(n - l + 1, g);       for (auto& t : w) {         t.first += l;         vp.push_back(make_pair(make_pair(t.first, t.first + t.second),                                t.first + t.second + t.second));         a[t.first] ^= 1;         a[t.first + t.second] ^= 1;         a[t.first + t.second + t.second] ^= 1;       }     } catch (...) {       puts( NO );       return 0;     }     for (int i = 0; i <= n + 1; ++i)       if (a[i]) throw  GG ;     puts( YES );     printf( %d n , int(vp.size()));     for (auto t : vp)       printf( %d %d %d n , t.first.first, t.first.second, t.second);   }   