You are given an integer N. Determine if there exists a tree with 2N vertices numbered 1 to 2N satisfying the following condition, and show one such tree if the answer is yes.

* Assume that, for each integer i between 1 and N (inclusive), Vertex i and N+i have the weight i. Then, for each integer i between 1 and N, the bitwise XOR of the weights of the vertices on the path between Vertex i and N+i (including themselves) is i.

Constraints

* N is an integer.
* 1 \leq N \leq 10^{5}

Input

Input is given from Standard Input in the following format:


N


Output

If there exists a tree satisfying the condition in the statement, print `Yes`; otherwise, print `No`. Then, if such a tree exists, print the 2N-1 edges of such a tree in the subsequent 2N-1 lines, in the following format:


a_{1} b_{1}
\vdots
a_{2N-1} b_{2N-1}


Here each pair (a_i, b_i) means that there is an edge connecting Vertex a_i and b_i. The edges may be printed in any order.

Examples

Input

3


Output

Yes
1 2
2 3
3 4
4 5
5 6


Input

1


Output

No

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
import sys, collections

def solve():
	input = sys.stdin.readline
	N = int(input())
	k = 1
	while k <= N:
		if k == N:
			print('No')
			break
		else:
			k *= 2
	else:
		if N % 2 == 1:
			print('Yes')
			ans = ''
			ans += '1 2\n'
			ans += '2 3\n'
			ans += '3 ' + str(N + 1) + '\n'
			ans += str(N + 1) + ' ' + str(N + 2) + '\n'
			ans += str(N + 2) + ' ' + str(N + 3) + '\n'
			for i in range(2, N // 2 + 1):
				ans += str(2 * i) + ' ' + str(2 * i + 1) + '\n'
				ans += str(2 * i + 1) + ' 1\n'
				ans += '1 ' + str(N + 2 * i) + '\n'
				ans += str(N + 2 * i) + ' ' + str(N + 2 * i + 1) + '\n'
			print(ans)
		else:
			print('Yes')
			ans = ''
			ans += '1 2\n'
			ans += '2 3\n'
			ans += '3 ' + str(N + 1) + '\n'
			ans += str(N + 1) + ' ' + str(N + 2) + '\n'
			ans += str(N + 2) + ' ' + str(N + 3) + '\n'
			for i in range(2, N // 2):
				ans += str(2 * i) + ' ' + str(2 * i + 1) + '\n'
				ans += str(2 * i + 1) + ' 1\n'
				ans += '1 ' + str(N + 2 * i) + '\n'
				ans += str(N + 2 * i) + ' ' + str(N + 2 * i + 1) + '\n'
			b = N ^ N - 1
			ans += str(N) + ' ' + str(N - 1) + '\n'
			if b % 2 == 1:
				ans += str(N + b - 1) + ' ' + str(2 * N)
			else:
				ans += str(b + 1) + ' ' + str(2 * N)
			print(ans)
	return 0
solve()


n = int(input())
b = 1 << n.bit_length() - 1
if n - b == 0:
	print('No')
else:
	print('Yes')
	print(1, 2)
	print(2, 3)
	print(3, n + 1)
	print(n + 1, n + 2)
	print(n + 2, n + 3)
	for i in range(4, n, 2):
		print(i, i + 1)
		print(i + n, i + n + 1)
		print(1 + n, i + n)
		print(1 + n, i + 1)
	if ~n & 1:
		print(n, b + n)
		a = n ^ b ^ 1
		print(n + n, a)


N = int(input())
if N & -N == N:
	print('No')
	exit()
print('Yes')
P = [[] for i in range(2 * N)]
X = 1
while 2 * X - 1 <= N:
	X *= 2
X -= 1
for i in range(X - 1):
	P[i].append(i + 1)
	P[N + i].append(N + i + 1)
P[X - 1].append(N)
while X + 2 <= N:
	P[X].append(X + 1)
	P[0].append(X + 1)
	P[0].append(X + N)
	P[X + N].append(X + N + 1)
	X += 2
if X != N:
	X = N & -N
	P[X - 1].append(N - 1)
	if X == 2:
		P[N - X].append(2 * N - 1)
	else:
		P[2 * N - X - 1].append(2 * N - 1)
for i in range(len(P)):
	for j in range(len(P[i])):
		print(i + 1, P[i][j] + 1)


N = int(input())
n = 1 << N.bit_length() - 1
if N == n:
	print('No')
else:
	print('Yes')
	ANS = []
	if N % 2:
		for i in range(1, n - 1):
			ANS.append((i, i + 1))
		ANS.append((n - 1, N + 1))
		for i in range(1, n - 1):
			ANS.append((i + N, i + N + 1))
		for i in range(0, N - n, 2):
			ANS.append((1 + N, i + n))
			ANS.append((i + n, i + n + 1))
			ANS.append((1 + N, i + n + 1 + N))
			ANS.append((i + n + 1 + N, i + n + N))
	else:
		(a, b, c) = (N - 2, N - 1, N)
		X = [i for i in range(1, n) if i != a ^ c] + [c, a]
		for i in range(n - 1):
			ANS.append((X[i], X[i + 1]))
		ANS.append((X[n - 1], X[0] + N))
		for i in range(n - 1):
			ANS.append((X[i] + N, X[i + 1] + N))
		for i in range(0, N - n - 3, 2):
			ANS.append((1 + N, i + n))
			ANS.append((i + n, i + n + 1))
			ANS.append((1 + N, i + n + 1 + N))
			ANS.append((i + n + 1 + N, i + n + N))
		ANS.append((a, a ^ c))
		ANS.append((c, (a ^ c) + N))
		ANS.append((1 + N, b))
		ANS.append((a, b + N))
	if N == 3:
		ANS = [(1, 2), (2, 3), (3, 4), (4, 5), (5, 6)]
	for ans in ANS:
		print(*ans)


def is_2power(n: int) -> bool:
	a = 1
	while a < n:
		a <<= 1
	return a == n

def skolem_xor_tree(N: int) -> list:
	if is_2power(N):
		return []
	res = [(1, 2), (2, 3), (3, N + 1), (N + 1, N + 2), (N + 2, N + 3)]
	for a in range(4, N + N % 2, 2):
		res.append((1, a))
		res.append((a, a + 1))
		res.append((1, N + a + 1))
		res.append((N + a + 1, N + a))
	if N % 2 == 0:
		a = N ^ 1
		b = None
		for i in range(2, N):
			if a ^ i < N:
				a = a ^ i
				b = i
				break
		if not b:
			raise Exception()
		if a < N and a % 2 == 1:
			a += N
		if b < N and b % 2 == 1:
			b += N
		res.append((a, N))
		res.append((b, N + N))
	return res
N = int(input())
ans = skolem_xor_tree(N)
if ans:
	print('Yes')
	for (a, b) in ans:
		print(a, b)
else:
	print('No')


n = int(input())
(p, r) = (print, range)
if n & -n == n:
	p('No')
	exit(0)
p('Yes')
if n == 3:
	p(1, 2)
	p(2, 3)
	p(3, 4)
	p(4, 5)
	p(5, 6)
	exit(0)
k = 1
while k * 2 < n:
	k *= 2
for i in r(k - 2):
	p(i + 1, i + 2)
p(k - 1, n + 1)
for i in r(k - 2):
	p(n + i + 1, n + i + 2)
p(n + k, n + 1)
p(n + k + 1, k)
for i in r(n - k):
	p(n + i + 1, n + k + i + 1)
	p(n + k + i, k + i + 1)


n = int(input())
if bin(n).count('1') == 1:
	print('No')
else:
	print('Yes')
	print('1 2')
	print('2 3')
	print('3 {0}'.format(n + 1))
	print('{0} {1}'.format(n + 1, n + 2))
	print('{0} {1}'.format(n + 2, n + 3))
	if n >= 5:
		if n % 2 == 1:
			for i in range(4, n + 1):
				print('1 {0}'.format(i))
				if i % 2 == 0:
					print('{0} {1}'.format(i, i + 1 + n))
				else:
					print('{0} {1}'.format(i, i - 1 + n))
		else:
			for i in range(4, n):
				print('1 {0}'.format(i))
				if i % 2 == 0:
					print('{0} {1}'.format(i, i + 1 + n))
				else:
					print('{0} {1}'.format(i, i - 1 + n))
			print('{0} {1}'.format(n - 1, n))
			print('{0} {1}'.format(n - 1 ^ 1 ^ n, n * 2))


n = int(input())
s = len(bin(n)) - 2
if 2 ** (s - 1) == n:
	print('No')
elif n == 3:
	print('Yes')
	for i in range(1, 6):
		print(i, i + 1)
else:
	print('Yes')
	print(2 ** (s - 1) - 1, 1 + n)
	for i in range(1, 2 ** (s - 1) - 1):
		print(i, i + 1)
		print(i + n, i + n + 1)
	print(2 ** (s - 1), 2 ** (s - 1) + 1)
	print(2 ** (s - 1) + 1 + n, 1)
	print(2 ** (s - 1), 1)
	print(2 ** (s - 1) + n, 2 ** (s - 1) + 1 + n)
	for i in range(2 ** (s - 1) + 2, n + 1):
		print(i, i - 1 + n)
		print(i + n, i - 2 ** (s - 1))


n = int(input())
if n <= 2 or n == 4:
	print('No')
elif n == 3:
	print('Yes')
	for i in range(5):
		print(i + 1, i + 2)
elif n % 2 == 0:
	nn = n.bit_length()
	if n == 2 ** (nn - 1):
		print('No')
	else:
		print('Yes')
		print(1, 2)
		print(2, 3)
		print(3, n + 1)
		print(n + 1, n + 2)
		print(n + 2, n + 3)
		for i in range(4, n):
			print(n + 1, i)
			if i % 2 == 0:
				print(i, i + n + 1)
			else:
				print(i, i + n - 1)
		(n1, n2) = (2 ** (nn - 1), n + 1 - 2 ** (nn - 1))
		print(n1, n)
		print(n2, 2 * n)
else:
	print('Yes')
	print(1, 2)
	print(2, 3)
	print(3, n + 1)
	print(n + 1, n + 2)
	print(n + 2, n + 3)
	for i in range(4, n + 1):
		print(1, i)
		if i % 2 == 0:
			print(i, i + n + 1)
		else:
			print(i, i + n - 1)


def main():
	import sys
	input = sys.stdin.readline
	N = int(input())
	k = N.bit_length()
	if 1 << k - 1 == N:
		print('No')
		exit()
	print('Yes')
	if N == 3:
		for i in range(1, 6):
			print(i, i + 1)
		exit()
	N0 = 1 << k - 1
	e = [(N0 - 1, N + 1)]
	for i in range(1, N0 - 1):
		e.append((i, i + 1))
		e.append((i + N, i + 1 + N))
	if N % 2 == 0:
		v = N ^ N0
		e.append((N, v))
		e.append((N * 2, N0))
		for i in range(N0, N):
			if i % 2 == 0:
				e.append((i, v))
				e.append((i + N, i + N + 1))
			else:
				e.append((i, i - 1))
				e.append((i + N, v + 1))
	else:
		for i in range(N0, N + 1):
			if i % 2 == 0:
				e.append((i, 2))
				e.append((i + N, i + 1 + N))
			else:
				e.append((i, i - 1))
				e.append((i + N, 3 + N))
	for edge in e:
		print(*edge)
main()


n = int(input())
t = n
while t > 0 and t % 2 == 0:
	t //= 2
ans = t != 1
print(['No', 'Yes'][ans])
if not ans:
	exit()
print(1, 2)
for i in range(2, n, 2):
	print(i, i + 1)
	print(i + 1, n + 1)
	print(n + 1, n + i)
	print(n + i, n + i + 1)
if n % 2 == 0:
	nob = len(bin(n)[2:])
	a = 1 << nob - 1
	b = n + 1 ^ a
	a = n + a if a % 2 == 0 else a
	b = n + b if b % 2 == 0 else b
	print(n, a)
	print(b, 2 * n)


N = int(input())
if N & N - 1 == 0:
	print('No')
	exit()
print('Yes')
print(1, 2)
print(2, 3)
print(3, N + 1)
print(N + 1, N + 2)
print(N + 2, N + 3)
for i in range(4, N, 2):
	print(i, i + 1)
	print(i + 1, N + 1)
	print(N + 1, N + i)
	print(N + i, N + i + 1)
if N % 2 == 0:
	print(N, N - 1)
	x = N ^ N - 1 ^ 1
	if x % 2 == 0:
		print(N + x, 2 * N)
	else:
		print(x, 2 * N)


N = int(input())
res = 'Yes'
k = 0
while 2 ** (k + 1) - 1 <= N:
	k += 1
K = 2 ** k - 1
if N == 1:
	res = 'No'
if N == K + 1:
	res = 'No'
if N % 2 == 0:
	M = N - 1
else:
	M = N
if (M - K) % 4 == 0 and M > K:
	L = M - 2
else:
	L = M
P = N - K
if P % 2 == 0:
	P = 2
print(res)
if res == 'Yes':
	line = list(range(1, K + 1))
	line.remove(P)
	line = [1, P] + line[1:]
	for i in range(K - 1):
		print(line[i], line[i + 1])
	print(line[-1], N + 1)
	for i in range(K - 1):
		print(N + line[i], N + line[i + 1])
	if L > K:
		print(1, K + 1)
		for i in range(K + 1, L):
			print(i, i + 1)
		for i in range(K + 1, L):
			print(N + i, N + i + 1)
		print(N + L, 1)
	if M > L:
		print(N + 1, M - 1)
		print(M - 1, M)
		print(N + M - 1, N + M)
		print(N + M, N + 1)
	if N > M:
		print(N, K + 1)
		print(N + N, P)


n = int(input())
b = 1
while b & n == 0:
	b *= 2
if b == n:
	print('No')
else:
	print('Yes')
	print(1, 2)
	for i in range(2, n, 2):
		print(i, i + 1)
		print(i + 1, n + 1)
		print(n + 1, n + i)
		print(n + i, n + i + 1)
	if n % 2 == 0:
		print(n, n + b)
		print(n - b + 1, n * 2)


from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

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

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	return list(sys.stdin.readline())[:-1]

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def A():
	n = I()
	a = LI()
	ans = 0
	for i in a:
		ans ^= i
	if not ans:
		print('Yes')
	else:
		print('No')
	return

def B():
	(n, m) = LI()
	return

def C():
	n = I()
	p = [1 << i for i in range(100)]
	if n in p:
		print('No')
		quit()
	if n + 1 in p:
		print('Yes')
		for i in range(1, 2 * n):
			print(i, i + 1)
		quit()
	ans = []
	for i in range(1, 3):
		ans.append((i, i + 1))
	ans.append((3, n + 1))
	for i in range(1, 3):
		ans.append((i + n, i + n + 1))
	u = 1
	d = 1
	for i in range(2, n // 2 + n % 2):
		ans.append((u, 2 * i))
		ans.append((d, 2 * i + 1))
		ans.append((2 * i, 2 * i + n + 1))
		ans.append((2 * i + 1, 2 * i + n))
		u = 2 * i + n + 1
		d = 2 * i + n
	if n % 2:
		print('Yes')
		for (i, j) in ans:
			print(i, j)
	else:
		ans.append((n - 1, n))
		for i in range(n):
			if p[i] & n:
				break
		ans.append((p[i + 1] - 2, 2 * n))
		print('Yes')
		for (i, j) in ans:
			print(i, j)
	return

def D():
	n = I()
	return

def E():
	n = I()
	return

def F():
	n = I()
	return
C()


n = int(input())
nn = n
f = lambda x, y: x + y * nn
g = lambda x: x if x % 2 == 1 else x + nn
b = bin(n)
if b.count('0') == len(b) - 2:
	print('No')
	exit(0)
ret = [[f(1, 0), f(2, 0)], [f(2, 0), f(3, 0)], [f(3, 0), f(1, 1)], [f(1, 1), f(2, 1)], [f(2, 1), f(3, 1)]]
if n % 2 == 0:
	p = 2 ** (len(b) - 3)
	q = n ^ 1 ^ p
	ret.append([g(p), f(n, 0)])
	ret.append([g(q), f(n, 1)])
	n -= 1
while n > 3:
	ret.append([f(n - 1, 0), f(n, 0)])
	ret.append([f(n, 0), f(1, 1)])
	ret.append([f(1, 1), f(n - 1, 1)])
	ret.append([f(n - 1, 1), f(n, 1)])
	n -= 2
print('Yes')
for (x, y) in ret:
	print(x, y)