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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, ans[N];
int Write[20], WRI;
void judge() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
int read() {
  int d = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') d = d * 10 + c - 48, c = getchar();
  return d * f;
}
void write(int x) {
  if (!x) {
    putchar('0');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  for (WRI = 1; x; x /= 10, WRI++) Write[WRI] = x % 10;
  for (int i = WRI - 1; i; i--) putchar((char)(Write[i] + 48));
}
int main() {
  n = read();
  int x = 1;
  for (; x <= n; x <<= 1)
    ;
  x >>= 1;
  int ljj = x;
  if (n & 1)
    puts("NO");
  else {
    puts("YES");
    for (int i = n; i >= 1; i--) {
      if (x > i) x >>= 1;
      if (!ans[i]) {
        int y = x - (i - x) - 1;
        ans[y] = i;
        ans[i] = y;
      }
    }
    for (int i = 1; i < n; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[n]);
  }
  x = ljj;
  if (n == x || n < 6)
    puts("NO");
  else {
    puts("YES");
    if (n == 6)
      puts("5 3 2 6 1 4");
    else {
      printf("5 3 2 6 1 7 4 ");
      for (int i = 8; i <= n; i++) {
        x = min((i << 1) - 1, n);
        for (int j = i; j < x; j++) printf("%d ", j + 1);
        printf("%d ", i);
        i = x;
      }
    }
  }
  return 0;
}