#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100010;
const int inf = 2147483647;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x * f;
}
int n, l, a[Maxn];
void print(int x) {
  if (!x) return;
  if (x == 2) {
    printf("2 1 ");
    return;
  }
  l = 0;
  int t = x;
  while (t) ++l, t >>= 1;
  int tmp = ((1 << l - 1) - 1 << 1) ^ x;
  print(tmp);
  for (int i = x; i > tmp; i--) printf("%d ", i);
}
int main() {
  n = read();
  if (n & 1)
    puts("NO");
  else
    puts("YES"), print(n), puts("");
  if (n < 6) return puts("NO"), 0;
  int flag = 0;
  int t = n;
  while (t) {
    if (t & 1) flag++;
    t >>= 1;
  }
  if (flag == 1) return puts("NO"), 0;
  puts("YES");
  memset(a, 0, sizeof(a));
  if (n & 1) {
    a[1] = 5, a[5] = 7, a[7] = 1, a[4] = 6, a[6] = 4;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
  if (n % 4 == 2) {
    a[1] = 3, a[3] = 1, a[2] = n, a[n] = 2;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
  if (n % 4 == 0) {
    a[n] = n - 1, a[n - 1] = n, a[n - 3] = n - 4, a[n - 4] = n - 3,
    a[2] = n - 2, a[n - 2] = 2, a[1] = 3, a[3] = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
}

### Prompt

Your challenge is to write a Cpp solution to the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100010;
const int inf = 2147483647;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x * f;
}
int n, l, a[Maxn];
void print(int x) {
  if (!x) return;
  if (x == 2) {
    printf("2 1 ");
    return;
  }
  l = 0;
  int t = x;
  while (t) ++l, t >>= 1;
  int tmp = ((1 << l - 1) - 1 << 1) ^ x;
  print(tmp);
  for (int i = x; i > tmp; i--) printf("%d ", i);
}
int main() {
  n = read();
  if (n & 1)
    puts("NO");
  else
    puts("YES"), print(n), puts("");
  if (n < 6) return puts("NO"), 0;
  int flag = 0;
  int t = n;
  while (t) {
    if (t & 1) flag++;
    t >>= 1;
  }
  if (flag == 1) return puts("NO"), 0;
  puts("YES");
  memset(a, 0, sizeof(a));
  if (n & 1) {
    a[1] = 5, a[5] = 7, a[7] = 1, a[4] = 6, a[6] = 4;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
  if (n % 4 == 2) {
    a[1] = 3, a[3] = 1, a[2] = n, a[n] = 2;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
  if (n % 4 == 0) {
    a[n] = n - 1, a[n - 1] = n, a[n - 3] = n - 4, a[n - 4] = n - 3,
    a[2] = n - 2, a[n - 2] = 2, a[1] = 3, a[3] = 1;
    for (int i = 1; i <= n; i++) {
      if (a[i])
        printf("%d ", a[i]);
      else {
        if (i & 1)
          printf("%d ", i - 1);
        else
          printf("%d ", i + 1);
      }
    }
    return 0;
  }
}

```