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;
int p[100005];
void dfs(int x, int t) {
  if (x == 0) return;
  int i;
  for (i = 20; i > 0; i--) {
    if ((1 << i) <= x) {
      dfs(x - (1 << i), t ^ (1 << i));
      break;
    }
  }
  int j;
  for (j = 0; j < (1 << i); j++) {
    int t1 = ((1 << i) - 1) ^ j;
    int t2 = j;
    if (t2 + (1 << i) <= x) t2 += (1 << i);
    if (t1 == 0) t1 += (1 << i);
    p[t2] = t1 ^ t;
  }
}
bool not_ok(int x) {
  int i;
  for (i = 0; i < 20; i++) {
    if ((1 << i) == x) return true;
  }
  return false;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1) {
    puts("NO");
  } else {
    dfs(n, 0);
    puts("YES");
    int i;
    for (i = 1; i <= n; i++) {
      printf("%d ", p[i]);
    }
    printf("\n");
  }
  if (n <= 5) {
    puts("NO");
  } else if (not_ok(n)) {
    puts("NO");
  } else {
    puts("YES");
    if (n % 2 == 1) {
      p[1] = 3;
      p[2] = 6;
      p[3] = 7;
      p[4] = 5;
      p[5] = 4;
      p[6] = 2;
      p[7] = 1;
      int i;
      for (i = 8; i <= n; i += 2) {
        p[i] = i + 1;
        p[i + 1] = i;
      }
    } else {
      p[1] = 3;
      p[2] = 6;
      p[3] = 1;
      p[4] = 5;
      p[5] = 4;
      p[6] = 2;
      int i;
      for (i = 8; i < n; i += 2) {
        p[i] = i + 1;
        p[i + 1] = i;
      }
      if (n > 6) {
        p[n - 1] = 7;
        p[n - 2] = n;
        p[n] = n - 2;
        p[7] = n - 1;
      }
    }
    int i;
    for (i = 1; i <= n; i++) {
      printf("%d ", p[i]);
    }
    printf("\n");
  }
  return 0;
}