Ksenia has an array $a$ consisting of $n$ positive integers $a_1, a_2, \ldots, a_n$. 

In one operation she can do the following:   choose three distinct indices $i$, $j$, $k$, and then  change all of $a_i, a_j, a_k$ to $a_i \oplus a_j \oplus a_k$ simultaneously, where $\oplus$ denotes the bitwise XOR operation. 

She wants to make all $a_i$ equal in at most $n$ operations, or to determine that it is impossible to do so. She wouldn't ask for your help, but please, help her!


-----Input-----

The first line contains one integer $n$ ($3 \leq n \leq 10^5$) — the length of $a$.

The second line contains $n$ integers, $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq 10^9$) — elements of $a$.


-----Output-----

Print YES or NO in the first line depending on whether it is possible to make all elements equal in at most $n$ operations.

If it is possible, print an integer $m$ ($0 \leq m \leq n$), which denotes the number of operations you do.

In each of the next $m$ lines, print three distinct integers $i, j, k$, representing one operation. 

If there are many such operation sequences possible, print any. Note that you do not have to minimize the number of operations.


-----Examples-----
Input
5
4 2 1 7 2

Output
YES
1
1 3 4
Input
4
10 4 49 22

Output
NO



-----Note-----

In the first example, the array becomes $[4 \oplus 1 \oplus 7, 2, 4 \oplus 1 \oplus 7, 4 \oplus 1 \oplus 7, 2] = [2, 2, 2, 2, 2]$.

Difficulty: HARD
Tags: Bit manipulation

Mathematics

Constructive algorithms
Skill types: Bit manipulation

Starter code:

Solutions:
import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	if N % 2 == 1:
		print('YES')
		print(N - 2)
		for j in range(1, N - 1, 2):
			print(j, j + 1, j + 2)
		for j in range(N - 4, 0, -2):
			print(j, j + 1, j + 2)
		return
	x = A[0] ^ A[1] ^ A[2]
	y = 0
	for j in range(3, N):
		y ^= A[j]
	if x != y:
		print('NO')
		return
	print('YES')
	print(1 + (N - 5 if N > 4 else 0))
	print(1, 2, 3)
	for j in range(4, N - 1, 2):
		print(j, j + 1, j + 2)
	for j in range(N - 4, 3, -2):
		print(j, j + 1, j + 2)
	return
solve()


import sys
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
ans = []
for i in range(0, len(arr) - 2, 2):
	arr[i] = arr[i + 1] = arr[i + 2] = arr[i] ^ arr[i + 1] ^ arr[i + 2]
	ans.append((i, i + 1, i + 2))
for i in range(0, len(arr) - 2, 2):
	arr[i] = arr[i + 1] = arr[i] ^ arr[i + 1] ^ arr[len(arr) - 1]
	ans.append((i, i + 1, len(arr) - 1))
possible = True
for i in range(len(arr) - 1, 0, -1):
	if arr[i] != arr[i - 1]:
		possible = False
		break
if possible:
	print('YES')
	print(len(ans))
	for thing in ans:
		print(thing[0] + 1, thing[1] + 1, thing[2] + 1)
else:
	print('NO')


MOD = 1000000007
from collections import defaultdict as dd, Counter, deque

def si():
	return input()

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def out(v):
	print(v)

def spout():
	print(v, end=' ')

def d2b(n):
	return bin(n).replace('0b', '')

def twod(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def vow():
	return ['a', 'e', 'i', 'o', 'u']

def let():
	return [chr(i) for i in range(97, 123)]

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ispow2(x):
	return x and (not x & x - 1)

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def func(n):
	i = 1
	while i + 2 <= n:
		print(i, i + 1, i + 2)
		i += 2
		if i == n or i == n - 1:
			break
	i = 1
	while i + 3 < n:
		if n % 2 == 0:
			print(i, i + 1, n - 1)
		else:
			print(i, i + 1, n)
		i += 2
n = ii()
a = li()
if n % 2 == 0:
	ans = a[0]
	for i in range(1, n):
		ans ^= a[i]
	if ans != 0:
		print('NO')
	else:
		print('YES')
		print(n - 3)
		func(n)
else:
	print('YES')
	print(n - 2)
	func(n)


n = int(input())
s = input()
list1 = s.split()
t = 0
for i in range(n):
	t = t ^ int(list1[i])
if n % 2 == 0 and t != 0:
	print('NO')
elif n % 2 == 0:
	print('YES')
	n = n - 1
	print(n - 2)
	for i in range(1, n - 1, 2):
		print(i, i + 1, i + 2)
	i = n - 2
	while i >= 3:
		print(i - 2, i - 1, i)
		i = i - 2
else:
	print('YES')
	print(n - 2)
	for i in range(1, n - 1, 2):
		print(i, i + 1, i + 2)
	i = n - 2
	while i >= 3:
		print(i - 2, i - 1, i)
		i = i - 2


n = int(input())
arr = [int(i) for i in input().split()]
if n % 2 == 1:
	print('YES')
	print(n - 2)
	for i in range(n // 2):
		print(str(2 * i + 1), str(2 * i + 2), str(2 * i + 3))
	for i in range(n // 2 - 1):
		print(str(2 * i + 1), str(2 * i + 2), str(n - 1))
else:
	xor = arr[0]
	for i in range(1, n):
		xor = xor ^ arr[i]
	if xor == 0:
		print('YES')
		print(n - 2)
		for i in range(n // 2 - 1):
			print(str(2 * i + 1), str(2 * i + 2), str(2 * i + 3))
		for i in range(n // 2 - 1):
			print(str(2 * i + 1), str(2 * i + 2), str(n - 1))
	else:
		print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
n = int(input())
a = list(map(int, input().split()))
x = 0
if n % 2 == 0:
	for i in a:
		x = x ^ i
	if x != 0:
		print('NO')
		sys.exit(0)
print('YES')
res = []
for i in range(1, n - 1, 2):
	res.append((1, i + 1, i + 2))
res = res + res
print(len(res))
for i in res:
	print(*i)


from sys import stdin
input = stdin.readline

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if n & 1 == 0:
		s = 0
		for (i, v) in enumerate(a):
			s ^= v
		if s != 0:
			print('NO')
			return
	print('YES')
	last = n if n & 1 == 1 else n - 1
	print(last - 1)
	res = []
	for i in range(1, n - 1 if n & 1 == 1 else n - 2, 2):
		res.append([i, i + 1, i + 2])
	for i in range(1, n - 1 if n & 1 == 1 else n - 2, 2):
		res.append([i, i + 1, last])
	print('\n'.join((' '.join(map(str, i)) for i in res)))
solve()


from sys import *
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))

def solve(a, n):
	if n == 1:
		return []
	if n == 3:
		return [[1, 2, 3]]
	if n % 2 == 1:
		ops = []
		for i in range(0, n - 2, 2):
			ops.append([i + 1, i + 2, i + 3])
		for i in reversed(range(0, n - 3, 2)):
			ops.append([i + 1, i + 2, i + 3])
		return ops
	else:
		x = 0
		for y in a:
			x ^= y
		if x != 0:
			print('NO')
			exit(0)
		ops = [[1, 2, 3]]
		a = a[3:]
		add = solve(a, n - 3)
		for i in range(len(add)):
			ops.append([add[i][j] + 3 for j in range(3)])
		return ops
ops = solve(a, n)
print('YES')
print(len(ops))
for i in range(len(ops)):
	print(ops[i][0], ops[i][1], ops[i][2])


n = int(input())
a = list(map(int, input().split()))
X = 0
for i in a:
	X = X ^ i
if n % 2 == 0 and X != 0:
	print('NO')
else:
	print('Yes')
	ans = []
	for i in range(3, n + 1, 2):
		ans.append([i - 2, i - 1, i])
	for i in range(2, n, 2):
		ans.append([i - 1, i, n])
	print(len(ans))
	for i in ans:
		print(*i)


n = int(input())
l = [int(x) for x in input().split()]
xx = 0
for i in l:
	xx = xx ^ i
if n % 2 == 0 and xx != 0:
	print('NO')
else:
	print('YES')
	ans = []
	for i in range(3, n + 1, 2):
		ans.append([i - 2, i - 1, i])
	for i in range(2, n, 2):
		ans.append([i - 1, i, n])
	print(len(ans))
	for i in ans:
		print(*i)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	n = ii()
	a = li()
	if n & 1:
		print('YES')
		print(n - 1)
		for i in range(1, n - 1, 2):
			print(1, i + 1, i + 2)
		for i in range(1, n - 1, 2):
			print(1, i + 1, i + 2)
	else:
		n -= 1
		ans = []
		for i in range(1, n - 1, 2):
			ans.append([1, i + 1, i + 2])
			a[0] ^= a[i] ^ a[i + 1]
		if a[0] == a[-1]:
			print('YES')
			print(n - 1)
			for i in range(1, n - 1, 2):
				ans.append([1, i + 1, i + 2])
			for i in ans:
				print(*i)
		else:
			print('NO')
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa = ifa[::-1]

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def binfun(x):
	c = 0
	for w in arr:
		c += ceil(w / x)
	return c

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def GP(it):
	return [(ch, len(list(g))) for (ch, g) in groupby(it)]

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None
t = 1
for i in range(t):
	n = N()
	a = RL()
	if not n & 1:
		res = 0
		for x in a:
			res ^= x
		if res != 0:
			print('NO')
			exit()
		else:
			print('YES')
			k = n // 2
			ans = []
			for i in range(k - 1):
				ans.append((2 * i + 1, 2 * i + 2, 2 * i + 3))
			ans.append((2 * k - 2, 2 * k - 1, 2 * k))
			for i in range(2 * k - 4, 0, -2):
				ans.append((i, i - 1, 2 * k))
			print(len(ans))
			for (x, y, z) in ans:
				print(x, y, z)
	else:
		print('YES')
		k = n // 2
		ans = []
		for i in range(1, 2 * k + 1, 2):
			ans.append((i, i + 1, i + 2))
		for i in range(1, 2 * k - 1, 2):
			ans.append((i, i + 1, 2 * k + 1))
		print(len(ans))
		for (x, y, z) in ans:
			print(x, y, z)


t = 1
while t > 0:
	t -= 1
	n = int(input())
	l = list(map(int, input().split()))
	flag = 1
	if n % 2 == 0:
		total = 0
		for i in range(n):
			total ^= l[i]
		if total != 0:
			flag = 0
			exit
		n -= 1
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(n - 1)
		for i in range((n - 1) // 2):
			print(1, 2 * i + 2, 2 * i + 3)
		for i in range((n - 1) // 2):
			print(1, 2 * i + 2, 2 * i + 3)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
from copy import deepcopy
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
arr = l()
x = 0
for i in arr:
	x ^= i
if not n & 1:
	if x != 0:
		out('NO')
		exit()
out('YES\n{}'.format(n - 1 - (1, 0)[n % 2]))
for i in range(0, n - 2, 2):
	outa(i + 1, i + 2, n)
for i in range(0, n - 2, 2):
	outa(i + 1, i + 2, n)


c = 0
n = int(input())
ans = list(map(int, input().split()))
if n % 2 == 0:
	xor = 0
	for i in ans:
		xor = xor ^ i
	if xor != 0:
		print('NO')
	else:
		print('YES')
		n = n - 1
		num = n // 2
		print(num + num - 1)
		oper = num + num - 1
		i = 1
		while i < n:
			print(i, i + 1, i + 2)
			i += 2
		i = 1
		while i <= n - 3:
			print(i, i + 1, n)
			i += 2
else:
	print('YES')
	num = n // 2
	print(num + num - 1)
	oper = num + num - 1
	i = 1
	while i < n:
		print(i, i + 1, i + 2)
		i += 2
	i = 1
	while i <= n - 3:
		print(i, i + 1, n)
		i += 2


import sys
input = sys.stdin.readline

def prog():
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		tot = 0
		for i in a:
			tot ^= i
		if tot != 0:
			print('NO')
			return
	print('YES')
	print(n - 1 - (n % 2 == 0))
	for j in range(2):
		for i in range(2, n - (n % 2 == 0) + 1, 2):
			print(1, i, i + 1)
prog()


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 1:
	print('YES')
	print(n - 2)
	print(*[1, 2, 3])
	for x in range(2, n - 2, 2):
		print(*[x + 1, x + 2, x + 3])
	for x in range(0, n - 3, 2):
		print(*[x + 1, x + 2, n])
else:
	xor = 0
	for i in range(n):
		xor = xor ^ arr[i]
	if xor == 0:
		print('YES')
		print(n - 3)
		print(*[1, 2, 3])
		for x in range(2, n - 3, 2):
			print(*[x + 1, x + 2, x + 3])
		for x in range(0, n - 4, 2):
			print(*[x + 1, x + 2, n - 1])
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
	ans ^= a[i]
if n % 2 == 0 and ans != 0:
	print('NO')
else:
	print('YES')
	res = []
	for i in range(1, n - 1, 2):
		res.append([i, i + 1, i + 2])
	for i in range(1, n - 1, 2):
		res.append([i, i + 1, n])
	print(len(res))
	for r in res:
		print(*r)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
sys.setrecursionlimit(100000)
INF = float('inf')
mod = 998244353
n = int(data())
a = mdata()
x = 0
for i in a:
	x ^= i
if n % 2 == 0 and x:
	out('NO')
	exit()
out('YES')
out(n - 2 + n % 2)
for i in range(1, n - 1 + n % 2, 2):
	outl([1, i + 1, i + 2])
for i in range(1, n - 1 + n % 2, 2):
	outl([1, i + 1, i + 2])


from sys import stdin

def c(i, j, k):
	tmp = a[i] ^ a[j] ^ a[k]
	a[i] = tmp
	a[j] = tmp
	a[k] = tmp
tt = 1
for loop in range(tt):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	if n % 2 == 1:
		ans = []
		for i in range(0, n - 2, 2):
			ans.append((i + 1, i + 2, i + 3))
			c(i, i + 1, i + 2)
		for i in range(n - 3, -1, -2):
			ans.append((i + 1, i + 2, i + 3))
			c(i, i + 1, i + 2)
		print('YES')
		print(len(ans))
		for i in ans:
			print(*i)
	else:
		last = a[-1]
		a = a[:-1]
		n -= 1
		ans = []
		for i in range(0, n - 2, 2):
			ans.append((i + 1, i + 2, i + 3))
			c(i, i + 1, i + 2)
		for i in range(n - 3, -1, -2):
			ans.append((i + 1, i + 2, i + 3))
			c(i, i + 1, i + 2)
		if a[0] == last:
			print('YES')
			print(len(ans))
			for i in ans:
				print(*i)
		else:
			print('NO')


n = int(input())
a = list(map(int, input().split()))
if n % 2 == 1:
	print('YES')
	print(n - 1)
	for i in range(n // 2):
		print(2 * i + 1, 2 * i + 2, n)
	for i in range(n // 2):
		print(2 * i + 1, 2 * i + 2, n)
else:
	ct = [0] * 31
	for x in a:
		for bit in range(31):
			ct[bit] ^= x >> bit & 1
	if max(ct) == 1:
		print('NO')
	else:
		print('YES')
		print(n - 2)
		for i in range(n // 2 - 1):
			print(2 * i + 1, 2 * i + 2, n - 1)
		for i in range(n // 2 - 1):
			print(2 * i + 1, 2 * i + 2, n - 1)


n = int(input())
arr = [int(x) for x in input().split()]
xor = 0
answer = []
for elem in arr:
	xor ^= elem
if n % 2 or not xor:
	for i in range(0, n - 1 >> 1):
		x = 2 * i
		y = arr[x] ^ arr[x + 1] ^ arr[x + 2]
		arr[x] = y
		arr[x + 1] = y
		arr[x + 2] = y
		answer.append((x + 1, x + 2, x + 3))
	for i in range(0, n - 1 >> 1):
		x = 2 * i
		y = arr[x] ^ arr[x + 1] ^ arr[n - 1]
		arr[x] = y
		arr[x + 1] = y
		arr[n - 1] = y
		answer.append((x + 1, x + 2, n))
	print('YES')
	print(len(answer))
	for (x, y, z) in answer:
		print(x, y, z)
else:
	print('NO')


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max, nsmallest, nlargest

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	tc = 1
	for _ in range(tc):
		n = ri()
		a = ria()
		i = 0
		ans = []
		while i + 1 < n - 1:
			k = a[i] ^ a[i + 1] ^ a[-1]
			ans.append([i + 1, i + 2, n])
			a[i] = k
			a[i + 1] = k
			a[-1] = k
			i += 2
		i = 0
		while i + 1 < n - 1:
			k = a[i] ^ a[i + 1] ^ a[-1]
			ans.append([i + 1, i + 2, n])
			a[i] = k
			a[i + 1] = k
			a[-1] = k
			i += 2
		if a[-1] == a[-2]:
			print('YES')
			print(len(ans))
			for i in ans:
				print(*i)
		else:
			print('NO')
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


n = int(input())
l = input().split()
li = [int(i) for i in l]
xori = 0
for i in range(n):
	xori ^= li[i]
if n % 2 == 0 and xori:
	print('NO')
	quit()
if n % 2 == 0:
	n = n - 1
print('YES')
l = []
for i in range((n - 1) // 2):
	l.append((2 * i + 1, 2 * i + 2, 2 * i + 3))
for i in range((n - 3) // 2):
	l.append((2 * i + 1, 2 * i + 2, n))
print(len(l))
for i in l:
	print(i[0], i[1], i[2])
quit()


n = int(input())
arr = [int(_) for _ in input('').split()]
p = n // 2
if n % 2 == 0:
	p = (n - 1) // 2
xor = arr[0]
for i in range(1, n):
	xor ^= arr[i]
if n % 2 != 0 or (xor == 0 and n % 2 == 0):
	print('YES')
	print(2 * p - 1)
	a = 1
	for i in range(p):
		print(a, a + 1, a + 2)
		a += 2
	a -= 4
	for i in range(p - 1):
		print(a, a + 1, a + 2)
		a -= 2
else:
	print('NO')


n = int(input())
l = list(map(int, input().split()))
if len(set(l)) == 1:
	print('YES')
	print(0)
	exit()
if n % 2 == 0:
	ans = []
	for i in range(1, n, 2):
		if i + 1 < n and i + 2 < n:
			ans.append([i + 1, i + 2, i + 3])
			z = l[i] ^ l[i + 1] ^ l[i + 2]
			(l[i], l[i + 1], l[i + 2]) = (z, z, z)
	i = n - 3
	while i >= 1:
		if i - 1 >= 0 and i - 2 >= 0:
			ans.append([i + 1, i, i - 1])
			z = l[i] ^ l[i - 1] ^ l[i - 2]
			(l[i], l[i - 1], l[i - 2]) = (z, z, z)
		i -= 2
	if len(set(l)) == 1:
		print('YES')
		print(len(ans))
		for i in ans:
			print(*i)
	else:
		print('NO')
else:
	print('YES')
	ans = []
	for i in range(0, n, 2):
		if i + 1 < n and i + 2 < n:
			ans.append([i + 1, i + 2, i + 3])
	i = n - 3
	while i >= 0:
		if i - 1 >= 0 and i - 2 >= 0:
			ans.append([i + 1, i, i - 1])
		i -= 2
	print(len(ans))
	for i in ans:
		print(*i)


from math import log2

def main_f():
	global count
	count = lenth - 1
	i = 0
	for _ in range(count):
		if i < 2 * (lenth // 2):
			if data[i] == data[i + 1] and data[i] == data[i + 2]:
				i += 2
				continue
			r = xor2(data[i], data[i + 1], data[i + 2])
			(data[i], data[i + 1], data[i + 2]) = (r, r, r)
			data_r.append([i + 1, i + 2, i + 3])
			i += 2
		else:
			if i == lenth - 1:
				i = lenth
				j = 0
			if data[j] == data[lenth - 1] and data[j + 1] == data[lenth - 1]:
				j += 2
				continue
			data_r.append([j + 1, j + 2, lenth])
			(data[j], data[j + 1]) = (data[lenth - 1], data[lenth - 1])
			j += 2

def xor2(a, b, c):
	r = a ^ b
	return r ^ c

def xor(a, b, c):
	while True:
		if a == b:
			result = 0
		elif a == 0:
			result = b
		elif b == 0:
			result = a
		elif log2(a) == int(log2(a)) or log2(b) == int(log2(b)):
			result = a + b
		else:
			result = abs(a - b)
		if c == 0:
			return result
		else:
			a = result
			b = c
			c = 0

def res():
	print(len(data_r))
	for el in data_r:
		print(*el)
lenth = int(input())
data = list(map(int, input().split()))
data_r = []
if lenth % 2 == 1:
	main_f()
	if len(set(data)) == 1 and len(data_r) <= lenth:
		print('YES')
		res()
	else:
		print('NO')
else:
	lenth -= 1
	a = data[-1]
	del data[-1]
	main_f()
	if data[-1] == a and len(data_r) <= lenth + 1:
		print('YES')
		res()
	else:
		print('NO')


n = int(input())
a = list(map(int, input().split(' ')))
if len(a) & 1:
	print('YES')
	print(n - 1)
	for i in range(2, n, 2):
		print(1, i, i + 1)
	for i in range(2, n, 2):
		print(1, i, i + 1)
else:
	sum = 0
	for x in a:
		sum ^= x
	if sum:
		print('NO')
	else:
		print('YES')
		print(n - 2)
		for i in range(2, n, 2):
			print(1, i, i + 1)
		for i in range(2, n, 2):
			print(1, i, i + 1)


n = int(input())
a = list(map(int, input().split()))
res = 'YES'
if n % 2 != 0:
	res = 'YES'
else:
	xor = 0
	n -= 1
	for i in a:
		xor ^= i
	if xor == 0:
		res = 'YES'
	else:
		res = 'NO'
if res == 'YES':
	print('YES')
	print(n - 1)
	i = 1
	while i < n:
		print(1, i + 1, i + 2)
		i += 2
	i = 1
	while i < n:
		print(1, i + 1, i + 2)
		i += 2
else:
	print('NO')


from functools import reduce
from operator import xor

def solve(a):
	if len(a) % 2 == 1:
		print('YES')
		print(len(a) - 2)
		for i in range(1, n - 1, 2):
			print(f'{i} {i + 1} {i + 2}')
		for i in range(n - 2, 1, -2):
			print(f'{i} {i - 1} {i - 2}')
	elif len(a) % 2 == 0 and reduce(xor, a) == 0:
		print('YES')
		print(len(a) - 3)
		for i in range(1, n - 2, 2):
			print(f'{i} {i + 1} {i + 2}')
		for i in range(n - 3, 1, -2):
			print(f'{i} {i - 1} {i - 2}')
	else:
		print('NO')
n = int(input())
a = list(map(int, input().split()))
solve(a)


import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
XOR = 0
for a in A:
	XOR ^= a
if n % 2 == 0 and XOR != 0:
	print('NO')
	sys.exit()
print('YES')
ANS = []
for i in range(2, n, 2):
	ANS.append((1, i, i + 1))
for i in range(2, n, 2):
	ANS.append((1, i, i + 1))
print(len(ANS))
for (i, j, k) in ANS:
	sys.stdout.write(str(i) + ' ' + str(j) + ' ' + str(k) + ' ' + '\n')


from functools import reduce
from operator import xor
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
N = int(input())
arr = list(map(int, input().split()))

def do(N, arr):
	if N % 2 == 0:
		if reduce(xor, arr) != 0:
			return (False, [])
	ans = []
	N -= N % 2 == 0
	for i in range(1, N + 1, 2):
		if i + 2 > N:
			break
		ans.append([i, i + 1, i + 2])
	for i in range(N - 2, -1, -2):
		if i - 2 < 1:
			break
		ans.append([i, i - 1, i - 2])
	return (True, ans)
(ok, ans) = do(N, arr)
if ok:
	print('YES')
	print(len(ans))
	for v in ans:
		print(*v)
else:
	print('NO')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key
from heapq import *
from math import gcd, factorial, floor, ceil, sqrt
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def testcase(t):
	for pp in range(t):
		solve(pp)

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	y %= p - 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
inf = pow(10, 20)
mod = 10 ** 9 + 7

def safe(x, y):
	global n, m
	return 0 <= x < n and 0 <= y < m

def solve(case):
	n = int(inp())
	a = lis()
	if len(set(a)) == 1:
		print('YES')
		print(0)
		return
	chck = 0
	for i in range(n):
		chck ^= a[i]
	if n % 2 == 0 and chck != 0:
		print('NO')
		return
	ans = []
	for i in range(1, n - 2, 2):
		ans.append((i, i + 1, i + 2))
	ans.append((0, n - 2, n - 1))
	for i in range(1, n - 2, 2):
		ans.append((0, i, i + 1))
	print('YES')
	print(len(ans))
	for i in range(len(ans)):
		print(ans[i][0] + 1, ans[i][1] + 1, ans[i][2] + 1)
testcase(1)


import sys
input = sys.stdin.readline
n = int(input())
l = input().split()
li = [int(i) for i in l]
xori = 0
for i in range(n):
	xori ^= li[i]
if xori == 0 or n % 2:
	print('YES')
	ans = []
	if n % 2 == 0:
		n -= 1
	for i in range(n // 2):
		ans.append((2 * i + 1, 2 * i + 2, n))
	for i in range(n // 2):
		ans.append((2 * i + 1, 2 * i + 2, n))
	print(len(ans))
	for i in ans:
		print(i[0], i[1], i[2])
else:
	print('NO')


import sys
import collections as cc
import itertools as it
import functools as ft
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
l = I()
ans = []
x = l[0]
for i in l[1:]:
	x ^= i
if n % 2 == 0 and x:
	print('NO')
else:
	print('YES')
	for i in range(2, n, 2):
		ans.append([1, i, i + 1])
	for i in range(2, n, 2):
		ans.append([1, i, i + 1])
	print(len(ans))
	for i in ans:
		print(i[0], i[1], i[2])


n = int(input())
a = list(map(int, input().split()))
if n & 1:
	print('YES')
	print(n - 1)
	for i in range(1, n, 2):
		print(i, i + 1, i + 2)
	for i in range(1, n, 2):
		print(i, i + 1, n)
else:
	s = 0
	for i in a:
		s ^= i
	if s > 0:
		print('NO')
	else:
		print('YES')
		print(n - 2)
		for i in range(1, n - 1, 2):
			print(i, i + 1, i + 2)
			print(i, i + 1, n)


n = int(input())
a = list(map(int, input().split()))
f = 0
even = False
if n % 2 == 0:
	even = True
	xor = a[0]
	for i in a[1:]:
		xor = xor ^ i
	if xor != 0:
		f = 1
if f == 1:
	print('NO')
else:
	print('YES')
	if not even:
		print(n // 2 + n // 2)
		for i in range(0, n - 1, 2):
			v = a[i] ^ a[i + 1] ^ a[n - 1]
			(a[i], a[i + 1], a[n - 1]) = (v, v, v)
			print(i + 1, i + 2, n)
		for i in range(0, n - 1, 2):
			v = a[i] ^ a[i + 1] ^ a[n - 1]
			(a[i], a[i + 1], a[n - 1]) = (v, v, v)
			print(i + 1, i + 2, n)
	else:
		print(n - 1)
		for i in range(0, n - 2, 2):
			v = a[i] ^ a[i + 1] ^ a[n - 1]
			(a[i], a[i + 1], a[n - 1]) = (v, v, v)
			print(i + 1, i + 2, n)
		for i in range(0, n - 2, 2):
			v = a[i] ^ a[i + 1] ^ a[n - 1]
			(a[i], a[i + 1], a[n - 1]) = (v, v, v)
			print(i + 1, i + 2, n)
		print(n - 2, n - 1, n)


import io
import os
from collections import Counter, defaultdict, deque
DEBUG = False

def solve(N, A):
	if N == 3:
		return 'YES'
	lines = []

	def op(i, j, k):
		x = A[i] ^ A[j] ^ A[k]
		A[i] = x
		A[j] = x
		A[k] = x
		lines.append(str(i + 1) + ' ' + str(j + 1) + ' ' + str(k + 1))
	if N % 2 == 1:
		for i in range(2, N, 2):
			op(i - 2, i - 1, i)
		for i in reversed(range(2, N, 2)):
			op(i - 2, i - 1, i)
	else:
		xor = 0
		for x in A:
			xor ^= x
		if xor != 0:
			return 'NO'
		for i in range(2, N, 2):
			op(i - 2, i - 1, i)
		op(N - 3, N - 2, N - 1)
		for i in reversed(range(2, N, 2)):
			op(i - 2, i - 1, i)
	if DEBUG:
		assert len(set(A)) == 1
		assert len(lines) <= N
	return 'YES\n' + str(len(lines)) + '\n' + '\n'.join(lines)
if DEBUG:
	import random
	random.seed(0)
	for _ in range(100):
		N = random.randint(3, 20)
		A = [random.randint(1, 10) for i in range(N)]
		print()
		print('tc', _, N, A)
		ans1 = solve(N, A)
		print(ans1)
	exit()
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = 1
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, A)
	print(ans)


import sys, os
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	n = int(input())
	arr = read()
	if n % 2:
		print('YES')
		ans = []
		for i in range(0, n - 1, 2):
			ans.append([i + 1, i + 2, n])
			arr[i] = arr[i + 1] = arr[n - 1] = arr[i] ^ arr[i + 1] ^ arr[n - 1]
		for i in range(0, n - 1, 2):
			ans.append([i + 1, i + 2, n])
			arr[i] = arr[i + 1] = arr[n - 1] = arr[i] ^ arr[i + 1] ^ arr[n - 1]
		print(len(ans))
		for i in ans:
			print(*i)
	else:
		x = 0
		for i in arr:
			x ^= i
		if x == 0:
			print('YES')
			ans = []
			for i in range(0, n - 2, 2):
				ans.append([i + 1, i + 2, n])
				arr[i] = arr[i + 1] = arr[n - 1] = arr[i] ^ arr[i + 1] ^ arr[n - 1]
			for i in range(0, n - 2, 2):
				ans.append([i + 1, i + 2, n])
				arr[i] = arr[i + 1] = arr[n - 1] = arr[i] ^ arr[i + 1] ^ arr[n - 1]
			print(len(ans))
			for i in ans:
				print(*i)
		else:
			print('NO')
main()


from sys import stdin, stdout
from math import factorial as f
from random import randint, shuffle
n = int(input())
(*a,) = map(int, input().split())
if not n & 1:
	x = 0
	for i in a:
		x ^= i
	if x:
		exit(print('NO'))
print('YES')
print(n - (n & 1 ^ 1) - 1)
for i in range(0, n - 2, 2):
	print(i + 1, i + 2, i + 3)
for i in range(0, n - 2, 2):
	print(i + 1, i + 2, n)


n = int(input())
a = list(map(int, input().split()))
if n % 2 != 0:
	print('YES')
	print(n - 2)
	for i in range(n):
		print(i * 2 + 1, i * 2 + 2, i * 2 + 3)
		if i * 2 + 3 == n:
			break
	for i in range(2, n):
		if n - i * 2 + 2 < 3:
			break
		print(n - i * 2, n - i * 2 + 1, n - i * 2 + 2)
else:
	xor = 0
	for num in a:
		xor = xor ^ num
	if xor != 0:
		print('NO')
	else:
		n -= 1
		print('YES')
		print(n - 2)
		for i in range(n):
			print(i * 2 + 1, i * 2 + 2, i * 2 + 3)
			if i * 2 + 3 == n:
				break
		for i in range(2, n):
			if n - i * 2 + 2 < 3:
				break
			print(n - i * 2, n - i * 2 + 1, n - i * 2 + 2)


from sys import stdin, stdout

def powerful_ksenia(n, a_a):
	xor = 0
	for a in a_a:
		xor ^= a
	if n % 2 == 0 and xor != 0:
		return ['NO']
	else:
		r_a = ['YES', str((n - 1) // 2 * 2)]
		for i in range((n - 1) // 2):
			r_a.append(str(1) + ' ' + str(i * 2 + 2) + ' ' + str(i * 2 + 3))
		for i in range((n - 1) // 2):
			r_a.append(str(1) + ' ' + str(i * 2 + 2) + ' ' + str(i * 2 + 3))
		return r_a
n = int(stdin.readline())
a_a = list(map(int, stdin.readline().split()))
r_a = powerful_ksenia(n, a_a)
for r in r_a:
	stdout.write(r + '\n')


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 1:
		(number_of_operations, moves, _) = change_bits(a, n)
		print_correct(moves, number_of_operations)
	else:
		(number_of_operations, moves, a[:-1]) = change_bits(a[:-1], n - 1)
		if a[0] == a[-1]:
			print_correct(moves, number_of_operations)
		else:
			print('NO')

def print_correct(moves, number_of_operations):
	print('YES')
	print(number_of_operations)
	for move in moves:
		print(move)

def change_bits(a, n):
	number_of_operations = 0
	moves = []
	for i in range(2, n, 2):
		number_of_operations += 1
		bitwise = a[i - 2] ^ a[i - 1] ^ a[i]
		a[i - 2] = bitwise
		a[i - 1] = bitwise
		a[i] = bitwise
		moves.append(f'{i - 1} {i} {i + 1}')
	for i in range(1, n - 1, 2):
		number_of_operations += 1
		bitwise = a[i - 1] ^ a[i] ^ a[n - 1]
		a[i - 1] = bitwise
		a[i] = bitwise
		moves.append(f'{i} {i + 1} {n}')
	return (number_of_operations, moves, a)
solve()


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = list(In())
		if n & 1 != 1:
			su = l[0]
			for i in range(1, n):
				su ^= l[i]
			if su != 0:
				no()
				return
		yes()
		z = (n - 1) // 2
		print(2 * z)
		for i in range(z):
			s = str(2 * i + 1) + ' ' + str(2 * i + 2) + ' ' + str(n)
			stdout.write(s + '\n')
		for i in range(z):
			s = str(2 * i + 1) + ' ' + str(2 * i + 2) + ' ' + str(n)
			stdout.write(s + '\n')
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


from sys import stdin, stdout
t = int(stdin.readline())
arr = list(map(int, stdin.readline().split()))
if t % 2 != 0:
	print('YES')
	print(t - 2)
	for i in range(1, t - 1, 2):
		print('{} {} {}'.format(i, i + 1, i + 2))
	for i in range(1, t - 3, 2):
		print('{} {} {}'.format(i, i + 1, t))
else:
	xor = 0
	for i in arr:
		xor = xor ^ i
	if xor != 0:
		print('NO')
	else:
		t = t - 1
		print('YES')
		print(t - 2)
		for i in range(1, t - 1, 2):
			print('{} {} {}'.format(i, i + 1, i + 2))
		for i in range(1, t - 3, 2):
			print('{} {} {}'.format(i, i + 1, t))


import sys
from collections import deque
n = int(input())
a = list(map(int, input().split()))
xor = 0
for i in a:
	xor ^= i
if n % 2 == 0 and xor != 0:
	print('NO')
	sys.exit()
print('YES')
ans = []
for i in range(2, n, 2):
	ans.append((1, i, i + 1))
for i in range(2, n, 2):
	ans.append((1, i, i + 1))
print(len(ans))
for (i, j, k) in ans:
	sys.stdout.write(str(i) + ' ' + str(j) + ' ' + str(k) + '\n')


import functools, operator, sys
n = int(input())
A = list(map(int, input().split()))
if not n & 1:
	if functools.reduce(operator.xor, A):
		print('NO')
		sys.exit()
	n -= 1
print('YES')
print(n - 1)
for i in range((n - 1) // 2):
	tmp = [1, i * 2 + 2, i * 2 + 3]
	print(*tmp)
for i in range((n - 1) // 2):
	tmp = [1, i * 2 + 2, i * 2 + 3]
	print(*tmp)


n = int(input())
a = [int(x) for x in input().split()]
xor_sum = 0
for x in a:
	xor_sum = xor_sum ^ x
if n % 2 == 0 and xor_sum != 0:
	print('NO')
else:
	print('YES')
	l = [(x, x + 1, x + 2) for x in range(1, n - 1, 2)]
	l += list(reversed(l))[1:]
	print(len(l))
	for x in l:
		print(' '.join([str(y) for y in x]))


mod = 10 ** 9 + 7

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	s = 0
	for x in a:
		s = s ^ x
	if s != 0 and n % 2 == 0:
		print('NO')
		return
	ans = []
	for i in range(3, n + 1, 2):
		ans.append([i - 2, i - 1, i])
	for i in range(2, n, 2):
		ans.append([i - 1, i, n])
	print('YES')
	print(len(ans))
	for i in range(len(ans)):
		print(*ans[i])
t = 1
while t > 0:
	solve()
	t -= 1


import sys
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
from itertools import *
from functools import *
n = ii1()
ar = iia()
xor = 0
for i in ar:
	xor ^= i
if xor != 0 and n % 2 == 0:
	print('NO')
else:
	print('YES')
	print((n - 1) // 2 * 2)
	for i in range(2, n, 2):
		print(i - 1, i, i + 1)
	for i in range((n - 1) // 2 * 2, 1, -2):
		print(i - 1, i, i + 1)


import sys
input = lambda : sys.stdin.readline().strip()
inp = lambda : list(map(int, sys.stdin.readline().strip().split()))
n = int(input())
a = list(map(int, input().split()))

def solve(a, n):
	ans = []
	i = 1
	for j in range(n // 2):
		ans.append([i, i + 1, i + 2])
		i += 2
	this = ans[-1][-1]
	for j in range(n // 2):
		ans.append([this, ans[j][1], ans[j][0]])
	print('YES')
	print(len(ans))
	for (i, j, k) in ans:
		print(i, j, k)
if n % 2 == 1:
	solve(a, n)
else:
	lol = 0
	for i in a:
		lol ^= i
	if lol != 0:
		print('NO')
	else:
		solve(a[:n - 1], n - 1)


import sys, os
import math
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def MI():
	return map(int, input().split())

def out(var):
	sys.stdout.write(str(var) + '\n')
n = int(input())
arr = list(map(int, input().split()))
out = []
even = False
if n % 2 == 0:
	ref = arr[-1]
	even = True
	arr = arr[:-1]
	n -= 1
i = 2
while i < n:
	out.append([i - 1, i, i + 1])
	k = arr[i - 2] ^ arr[i - 1] ^ arr[i]
	(arr[i - 2], arr[i - 1], arr[i]) = (k, k, k)
	i += 2
if even:
	if ref != arr[-1]:
		print('NO')
		exit()
i = 1
while i < n - 3:
	out.append([i, i + 1, n])
	arr[i - 1] = arr[-1]
	arr[i] = arr[-1]
	i += 2
print('YES')
print(len(out))
for i in out:
	print(*i)


import sys
import heapq
import copy
import math
import decimal
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def insr2():
	s = input()
	s = list(s[:len(s) - 1])
	s = [ord(s[i]) - ord('a') for i in range(len(s))]
	return s

def invr():
	return map(int, input().split())
ans = 0

def pr_list(a):
	print(*a, sep=' ')

def swap(a, b):
	temp = a
	a = b
	b = temp
	return [a, b]
mod = 1000000007

def pri(a, b):
	s = '? ' + str(a) + ' ' + str(b)
	print(s)
	sys.stdout.flush()

def solve():
	n = inp()
	a = inlt()
	ans = []
	for i in range(2, n, 2):
		dum = a[i - 2] ^ a[i - 1] ^ a[i]
		a[i - 2] = dum
		a[i - 1] = dum
		a[i] = dum
		ans.append([i - 1, i, i + 1])
	if n % 2 == 0:
		if a[n - 1] != a[n - 2]:
			print('NO')
			return
		n = n - 1
	for i in range(n - 3, 1, -2):
		dum = a[i - 2] ^ a[i - 1] ^ a[i]
		a[i - 2] = dum
		a[i - 1] = dum
		a[i] = dum
		ans.append([i - 1, i, i + 1])
	print('YES')
	print(len(ans))
	for i in ans:
		pr_list(i)
	return

def main():
	tests = 1
	limit = 10 ** 18
	ans = 0
	stack = []
	hashm = {}
	arr = []
	heapq.heapify(arr)
	for test in range(tests):
		solve()
main()


def solve(n, arr):
	xor_sum = arr[0]
	for i in range(1, n):
		xor_sum ^= arr[i]
	if n % 2 == 0:
		if xor_sum:
			print('NO')
			return
		else:
			n -= 1
	if n == 3:
		print(1)
		print(1, 2, 3)
		return
	print('YES')
	print(n - 2)
	for i in range(1, n - 1, 2):
		print(i, i + 1, i + 2)
	for i in range(n - 4, 0, -2):
		print(i, i + 1, i + 2)
n = int(input())
arr = list(map(int, input().split()))
solve(n, arr)


from math import *
from bisect import *
from collections import *
from random import *
from decimal import *
from random import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = 1
while t:
	t -= 1
	n = inp()
	a = lis()
	x = 0
	for i in a:
		x = x ^ i
	if x and n % 2 == 0:
		print('NO')
		exit(0)
	print('YES')
	if n % 2:
		print(n - 1)
		for i in range(n // 2):
			print(i + 1, n - i, (n + 1) // 2)
		for i in range(n // 2):
			print(i + 1, n - i, (n + 1) // 2)
	else:
		print(n - 2)
		n -= 1
		for i in range(n // 2):
			print(i + 1, n - i, (n + 1) // 2)
		for i in range(n // 2):
			print(i + 1, n - i, (n + 1) // 2)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from bisect import *
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import permutations
from copy import deepcopy
from heapq import *

def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	n = int(input())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print('YES')
		print(0)
	else:
		x = 0
		for i in range(n):
			x = x ^ a[i]
		if n % 2 == 0 and x != 0:
			print('NO')
		else:
			n = n - (n % 2 == 0)
			b = []
			for i in range(0, n - 1, 2):
				b.append([i + 1, i + 2, i + 3])
			for i in range(0, n - 3, 2):
				b.append([i + 1, i + 2, n])
			print('YES')
			print(len(b))
			for i in b:
				print(*i)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()
n0 = II()
n = n0 if n0 & 1 else n0 - 1
aa = LI()
ans = []
for i in range(0, n - 2, 2):
	aa[i] = aa[i + 1] = aa[i + 2] = aa[i] ^ aa[i + 1] ^ aa[i + 2]
	ans.append((i + 1, i + 2, i + 3))
if n0 & 1 == 0 and aa[-1] != aa[-2]:
	print('NO')
	exit()
for i in range(0, n - 4, 2):
	aa[i] = aa[i + 1] = aa[-1] = aa[i] ^ aa[i + 1] ^ aa[-1]
	ans.append((i + 1, i + 2, n))
print('YES')
print(len(ans))
for (i, j, k) in ans:
	print(i, j, k)


def resu(n, L):
	s = 0
	if n == 3:
		return [(1, 2, 3)]
	for i in range(n):
		x = L[i]
		s = x ^ s
	if n % 2 == 0 and s != 0:
		return -1
	if n % 2 == 1:
		res = []
		for _ in range(2):
			for i in range((n - 1) // 2):
				j = 2 * i + 1
				res.append((1, j + 1, j + 2))
		return res
	L.pop(-1)
	return resu(n - 1, L)
n = int(input())
L = [int(x) for x in input().split()]
K = resu(n, L)
if K == -1:
	print('NO')
else:
	print('YES')
	print(len(K))
	for x in K:
		(a, b, c) = x
		print(a, end=' ')
		print(b, end=' ')
		print(c)


for _ in range(1):
	n = int(input())
	arr = list(map(int, input().split()))
	out = []
	if n % 2:
		i = 2
		while i < n:
			out.append([i - 1, i, i + 1])
			k = arr[i - 2] ^ arr[i - 1] ^ arr[i]
			(arr[i - 2], arr[i - 1], arr[i]) = (k, k, k)
			i += 2
		i = 1
		while i < n - 3:
			out.append([i, i + 1, n])
			arr[i - 1] = arr[-1]
			arr[i] = arr[-1]
			i += 2
		print('YES')
		print(len(out))
		for i in out:
			print(*i)
	else:
		g = 0
		for i in arr:
			g ^= i
		if g:
			print('NO')
		else:
			arr = arr[:-1]
			n -= 1
			i = 2
			while i < n:
				out.append([i - 1, i, i + 1])
				k = arr[i - 2] ^ arr[i - 1] ^ arr[i]
				(arr[i - 2], arr[i - 1], arr[i]) = (k, k, k)
				i += 2
			i = 1
			while i < n - 3:
				out.append([i, i + 1, n])
				arr[i - 1] = arr[-1]
				arr[i] = arr[-1]
				i += 2
			print('YES')
			print(len(out))
			for i in out:
				print(*i)


import sys
from array import array
import typing as Tp

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def output(*args):
	sys.stdout.buffer.write(('\n'.join(map(str, args)) + '\n').encode('utf-8'))

def main():
	n = int(input())
	a = list(map(int, input().split()))
	ans = ['1 2 3']
	a[0] = a[1] = a[2] = a[0] ^ a[1] ^ a[2]
	for i in range(4, n, 2):
		a[i - 2] = a[i - 1] = a[i] = a[i - 2] ^ a[i - 1] ^ a[i]
		ans.append(f'{i - 1} {i} {i + 1}')
	if a[-1] != a[-2]:
		print('NO')
		exit()
	for i in range(n - (3 if n & 1 else 4), 1, -2):
		if a[i] != a[i - 1]:
			a[i] = a[i - 1] = a[i - 2] = a[i] ^ a[i - 1] ^ a[i - 2]
			ans.append(f'{i - 1} {i} {i + 1}')
	assert len(set(a)) == 1
	output('YES', str(len(ans)), '\n'.join(ans))
main()


import os, sys
from io import BytesIO, IOBase
from functools import reduce

def main():
	n = int(input())
	a = list(map(int, input().split()))
	r = reduce(lambda x, y: x ^ y, a)
	if n & 1 or not r:
		n -= not n & 1
		print('YES')
		print(n - 1)
		for i in range(2, n + 1, 2):
			print(1, i, i + 1)
		for i in range(2, n + 1, 2):
			print(1, i, i + 1)
	else:
		print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
n = int(input())
a = list(map(int, input().split()))
count = [0] * 40
for i in range(n):
	for j in range(40):
		if a[i] & 1 << j:
			count[j] = (count[j] + 1) % 2
if n % 2 == 0 and sum(count) != 0:
	print('NO')
	sys.exit()
print('YES')
ans = []
ans.append('1 2 3')
if n == 3:
	print(1)
	print(1, 2, 3)
	sys.exit()
if n % 2 == 1:
	pointer = 3
	while pointer + 4 <= n:
		t = [str(pointer), str(pointer + 1), str(pointer + 2)]
		ans.append(' '.join(t))
		pointer += 2
	t = [str(pointer), str(pointer + 1), str(pointer + 2)]
	ans.append(' '.join(t))
	pointer += 2
	for i in range(1, pointer, 2):
		t = [str(i), str(i + 1), str(pointer)]
		ans.append(' '.join(t))
else:
	pointer = 3
	while pointer + 2 <= n:
		t = [str(pointer), str(pointer + 1), str(pointer + 2)]
		ans.append(' '.join(t))
		t = [str(pointer - 1), str(pointer), str(pointer + 1)]
		ans.append(' '.join(t))
		pointer += 2
	t = [str(pointer - 1), str(pointer), str(pointer + 1)]
	ans.append(' '.join(t))
print(len(ans))
for i in ans:
	print(i)


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if n % 2:
		print('YES')
		print(n - 1)
		for i in range(0, n - 2, 2):
			print(i + 1, i + 2, n)
		for i in range(0, n - 2, 2):
			print(i + 1, i + 2, n)
	else:
		x = 0
		for i in arr:
			x ^= i
		if x:
			print('NO')
			continue
		print('YES')
		print(n - 2)
		for i in range(0, n - 3, 2):
			print(i + 1, i + 2, n)
		for i in range(0, n - 3, 2):
			print(i + 1, i + 2, n)


import sys
input = sys.stdin.readline

def solve(n):
	print('YES')
	ans = []
	for i in range(0, n - 1, 2):
		ans.append([i + 1, i + 2, i + 3])
	for i in range(n - 2, -1, -2):
		ans.append([n, i + 1, i])
	print(len(ans))
	for i in ans:
		print(*i)
n = int(input())
a = list(map(int, input().split()))
if n % 2:
	solve(n)
else:
	x = a[0]
	for i in range(1, n):
		x = x ^ a[i]
	if x != 0:
		print('NO')
	else:
		solve(n - 1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if not True else 1):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		xor = 0
		for i in a:
			xor ^= i
		if xor:
			print('NO')
			continue
	ans = []
	for i in range(0, n - 2, 2):
		ans += [[i + 1, i + 2, i + 3]]
	for i in range(0, n - 2, 2):
		ans += [[i + 1, i + 2, n]]
	print('YES')
	print(len(ans))
	for i in ans:
		print(*i)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	alst = list(map(int, input().split()))
	if n % 2 == 1:
		print('YES')
		ans = []
		for i in range(3, n + 1, 2):
			ans.append([i - 2, i - 1, i])
		for i in range(3, n - 1, 2):
			ans.append([i - 2, i - 1, n])
		print(len(ans))
		for row in ans:
			print(*row)
	else:
		tmp = 0
		for a in alst:
			tmp ^= a
		if tmp != 0:
			print('NO')
			return
		print('YES')
		ans = []
		for i in range(3, n + 1, 2):
			ans.append([i - 2, i - 1, i])
		for i in range(3, n - 1, 2):
			ans.append([i - 2, i - 1, n])
		print(len(ans))
		for row in ans:
			print(*row)
for _ in range(1):
	main()


from functools import reduce
n = int(input())
a = list(map(int, input().split()))

def solve(n):
	print('YES\n', n - 1, sep='')
	for i in range(n // 2):
		print(2 * i + 1, 2 * i + 2, n)
	for i in range(n // 2):
		print(2 * i + 1, 2 * i + 2, n)
if n % 2 == 1:
	solve(n)
elif reduce(lambda x, y: x ^ y, a, 0) > 0:
	print('NO')
else:
	solve(n - 1)


n = int(input())
a = list(map(int, input().split()))

def solveOdd(a, n):
	a = [(a[i], i + 1) for i in range(n)]
	a.sort(key=lambda x: x[0])
	ans = []
	for i in range(0, n - 2, 2):
		ans.append((a[i][1], a[i + 1][1], a[i + 2][1]))
		x = a[i][0] ^ a[i + 1][0] ^ a[i + 2][0]
		a[i:i + 3] = ((x, a[i][1]), (x, a[i + 1][1]), (x, a[i + 2][1]))
	for i in range(n - 3, -1, -2):
		ans.append((a[i][1], a[i + 1][1], a[n - 1][1]))
		x = a[i][0] ^ a[i + 1][0] ^ a[n - 1][0]
		a[i:i + 3] = ((x, a[i][1]), (x, a[i + 1][1]), (x, a[n - 1][1]))
	print(len(ans))
	for x in ans:
		print(x[0], x[1], x[2])
if n % 2:
	print('YES')
	solveOdd(a, n)
else:
	x = 0
	for i in range(n):
		x ^= a[i]
	if x != 0:
		print('NO')
	else:
		print('YES')
		solveOdd(a, n - 1)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
a = inlt()
can = True
if n % 2 == 0:
	totsum = 0
	for i in range(n):
		totsum = totsum ^ a[i]
	if totsum != 0:
		can = False
if can:
	print('YES')
else:
	print('NO')
if can:
	k = 0
	if n % 2 == 0:
		k = n // 2 - 1
	else:
		k = (n - 1) // 2
	print(2 * k - 1)
	for i in range(1, k + 1):
		print(1, 2 * i, 2 * i + 1)
	for i in range(1, k):
		print(2 * i, 2 * i + 1, 2 * k)


import sys, functools, collections, bisect, math, heapq
input = sys.stdin.readline
mod = 1000000007
n = int(input())
arr = list(map(int, input().strip().split()))
if n % 2:
	print('YES')
	print(n - 2)
	i = 1
	while i <= n - 2:
		print(i, i + 1, i + 2)
		i += 2
	i = 1
	while i < n - 2:
		print(i, i + 1, n)
		i += 2
else:
	xor = 0
	for i in arr:
		xor = xor ^ i
	if xor != 0:
		print('NO')
	else:
		print('YES')
		print(n - 2)
		i = 1
		while i <= n - 2:
			print(i, i + 1, i + 2)
			i += 2
		i = 1
		while i <= n - 2:
			print(i, i + 1, n)
			i += 2


from collections import deque
n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
	res = 0
	for i in range(n):
		res ^= a[i]
	if res:
		print('NO')
		exit()
print('YES')
deq = deque([(a[i], i) for i in range(n)])
ok = []
ope = []
while len(deq) > 2:
	(a, ai) = deq.popleft()
	(b, bi) = deq.popleft()
	(c, ci) = deq.popleft()
	ope.append((ai, bi, ci))
	ok.append((ai, bi))
	deq.append((c, ci))
(only, idx) = deq.popleft()
for (a, b) in ok:
	ope.append((a, b, idx))
print(len(ope))
for (i, j, k) in ope:
	print(i + 1, j + 1, k + 1)


from sys import exit
n = int(input())
a = [int(i) for i in input().split()]
if n % 2 == 0:
	kek = 0
	for el in a:
		kek ^= el
	if kek != 0:
		print('NO')
		exit(0)
	else:
		n -= 1
print('YES')
print(n - 1)
for i in range((n - 1) // 2):
	print(1, 2 * (i + 1), 2 * (i + 1) + 1)
for i in range((n - 1) // 2):
	print(1, 2 * (i + 1), 2 * (i + 1) + 1)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = 1
for _ in range(t):
	n = ip()
	arr = list(inp())
	if n & 1 == 1:
		ans = []
		for i in range(0, n - 1, 2):
			ele = arr[i] ^ arr[i + 1] ^ arr[i + 2]
			arr[i] = ele
			arr[i + 1] = ele
			arr[i + 2] = ele
			ans.append([i + 1, i + 2, i + 3])
		for i in range(0, n - 1, 2):
			ans.append([i + 1, i + 2, n])
			ele = arr[i] ^ arr[i + 1] ^ arr[n - 1]
			arr[i] = ele
			arr[i + 1] = ele
			arr[n - 1] = ele
		out('YES')
		out(len(ans))
		for i in ans:
			print(*i)
	else:
		xor = 0
		for i in arr:
			xor ^= i
		if xor == 0:
			ans = []
			for i in range(0, n - 2, 2):
				ele = arr[i] ^ arr[i + 1] ^ arr[i + 2]
				arr[i] = ele
				arr[i + 1] = ele
				arr[i + 2] = ele
				ans.append([i + 1, i + 2, i + 3])
			for i in range(0, n - 2, 2):
				ans.append([i + 1, i + 2, n - 1])
				ele = arr[i] ^ arr[i + 1] ^ arr[n - 2]
				arr[i] = ele
				arr[i + 1] = ele
				arr[n - 2] = ele
			out('YES')
			out(len(ans))
			for i in ans:
				print(*i)
		else:
			out('NO')


n = int(input())
a = [int(x) for x in input().split()]
xor = 0
if len(a) % 2 == 0:
	for i in a:
		xor ^= i
if n % 2 == 0 and xor != 0:
	print('NO')
else:
	print('YES')
	arr = [(i, i + 1, i + 2) for i in range(1, n - 1, 2)]
	arr += arr[::-1][1:]
	print(len(arr))
	for (i, j, k) in arr:
		print(i, j, k)