Problem: Given an integer N, find two permutations:

  1. Permutation p of numbers from 1 to N such that pi ≠ i and pi & i = 0 for all i = 1, 2, ..., N. 
  2. Permutation q of numbers from 1 to N such that qi ≠ i and qi & i ≠ 0 for all i = 1, 2, ..., N. 



& is the [bitwise AND operation](https://en.wikipedia.org/wiki/Bitwise_operation#AND).

Input

The input consists of one line containing a single integer N (1 ≤ N ≤ 105).

Output

For each subtask, if the required permutation doesn't exist, output a single line containing the word "NO"; otherwise output the word "YES" in the first line and N elements of the permutation, separated by spaces, in the second line. If there are several possible permutations in a subtask, output any of them.

Examples

Input

3


Output

NO
NO


Input

6


Output

YES
6 5 4 3 2 1 
YES
3 6 2 5 1 4

Solution (in PYTHON):

Solution:
'''
p does not exist if n is odd:
	for then there are more odd numbers than even in [n], and each odd number needs to be mapped to an even number (or the last bit will not AND to 0).

p can be found like this for all other n:
	if n = 2^k then map every number to its bitwise complement (ignore the first bit unless a number is 2^(k-1) or 2^k).
	otherwise write n = 2^k + r where r < 2^k. consider the solution for r,
		and map the first r numbers to the last r numbers using this solution, and vice versa.
		the remaining numbers are mapped like in the n=2^k case.

	example:
	n=4:
		001:  10 (bitwise complement of 01, ignoring the first bit)
		010:  01
		011: 100 (map to the last number)
		100: 011 (map to penultimate number)

	n=6=4+2:
		001: 110 (same as in n=2 solution but add the first bit)
		010: 101 (same as in n=2 solution but add the first bit)
		011: 100 (same as in n=4 solution)
		100: 011 (same as in n=4 solution)
		101: 010 (remove first bit, then same as in n=2 solution)
		110: 001 (remove first bit, then same as in n=2 solution)


q does not exist if n=2^k because n=2^k has its highest bit set and no other number less than it does.

q can be found like this:
	no solution up to n=5.
	n=6: 3 6 1 5 4 2
	n=7: 3 6 1 5 4 7 2
	n!=2^k:
		first 7 are permuted as above
		next group all numbers with the same highest bit set, and permute them arbitrarily (just cycle them one step)

'''

def rewrite(m):
	'assuming m>0, write m=2^k+r where 0<=r<2^k and return (k,r)'
	k = 1
	while True:
		if (1<<k)>m:
			powerof2=1<<(k-1)
			return (k-1,m-powerof2)
		k += 1

def q(n):
	if n < 6:
		return None
	if n == 6:
		return [3, 6, 1, 5, 4, 2]
	if n == 7:
		return [3, 6, 1, 5, 4, 7, 2]

	# no solution if n is a power of 2
	if rewrite(n)[1] == 0:
		return None

	permutation = [3, 6, 1, 5, 4, 7, 2]
	for i in xrange(8, n+1):
		# map i to i+1 unless i+1=2^k or i=n
		k,r = rewrite(i+1)
		if i!=n and r!=0:
			permutation.append(i+1)
		else:
			k,r = rewrite(i)
			permutation.append(1<<k)
	return permutation

def p(n):
	# no solution if n is odd
	if n%2 == 1:
		return None
	if n == 0:
		return []

	permutation = []
	k,r = rewrite(n)
	subsolution = p(r)
	powerof2 = (1<<k)
	for i in xrange(1,powerof2+1):
		if i < powerof2-1:
			complement = powerof2-1-i
			if complement > r:
				permutation.append(complement)
			else:
				permutation.append(complement+powerof2)
		elif i == powerof2-1:
			permutation.append(powerof2)
		elif i == powerof2:
			permutation.append(powerof2-1)
	for j in subsolution:
		permutation.append(j)

	return permutation

n=int(raw_input())

ans = p(n)
if not ans:
	print 'NO'
else:
	print 'YES'
	print ' '.join(map(str,ans))

ans = q(n)
if not ans:
	print 'NO'
else:
	print 'YES'
	print ' '.join(map(str,ans))