#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int a[MAXN];
void solve1(int n) {
  if (n & 1) {
    printf("NO\n");
    return;
  }
  puts("YES");
  int x = n;
  while (x) {
    int k = 0;
    while ((1 << k + 1) <= x) ++k;
    int i;
    for (i = 0; i + (1 << k) <= x; ++i) {
      a[i + (1 << k)] = (1 << k) - i - 1;
      a[(1 << k) - i - 1] = i + (1 << k);
    }
    x -= 2 * i;
  }
  for (int i = 1; i <= n; ++i) printf("%d%c", a[i], " \n"[i == n]);
}
void solve2(int n) {
  if (n < 7) {
    if (n == 6) {
      puts("YES");
      puts("3 6 2 5 1 4");
      return;
    }
    puts("NO");
    return;
  }
  int k = log(n) / log(2);
  if ((1 << k) == n || (1 << k + 1) == n) {
    puts("NO");
    return;
  }
  puts("YES");
  a[1] = 7, a[2] = 3, a[3] = 2, a[4] = 6, a[5] = 1, a[6] = 4, a[7] = 5;
  for (int k = 3; (1 << k) <= n; ++k) {
    int j;
    for (j = 0; j < (1 << k) - 1 && (1 << k) + j < n; ++j)
      a[(1 << k) + j] = (1 << k) + j + 1;
    a[(1 << k) + j] = (1 << k);
  }
  for (int i = 1; i <= n; ++i) printf("%d%c", a[i], " \n"[i == n]);
}
int main() {
  int n;
  scanf("%d", &n);
  solve1(n);
  solve2(n);
}

### Prompt

Your task is to create 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;
int a[MAXN];
void solve1(int n) {
  if (n & 1) {
    printf("NO\n");
    return;
  }
  puts("YES");
  int x = n;
  while (x) {
    int k = 0;
    while ((1 << k + 1) <= x) ++k;
    int i;
    for (i = 0; i + (1 << k) <= x; ++i) {
      a[i + (1 << k)] = (1 << k) - i - 1;
      a[(1 << k) - i - 1] = i + (1 << k);
    }
    x -= 2 * i;
  }
  for (int i = 1; i <= n; ++i) printf("%d%c", a[i], " \n"[i == n]);
}
void solve2(int n) {
  if (n < 7) {
    if (n == 6) {
      puts("YES");
      puts("3 6 2 5 1 4");
      return;
    }
    puts("NO");
    return;
  }
  int k = log(n) / log(2);
  if ((1 << k) == n || (1 << k + 1) == n) {
    puts("NO");
    return;
  }
  puts("YES");
  a[1] = 7, a[2] = 3, a[3] = 2, a[4] = 6, a[5] = 1, a[6] = 4, a[7] = 5;
  for (int k = 3; (1 << k) <= n; ++k) {
    int j;
    for (j = 0; j < (1 << k) - 1 && (1 << k) + j < n; ++j)
      a[(1 << k) + j] = (1 << k) + j + 1;
    a[(1 << k) + j] = (1 << k);
  }
  for (int i = 1; i <= n; ++i) printf("%d%c", a[i], " \n"[i == n]);
}
int main() {
  int n;
  scanf("%d", &n);
  solve1(n);
  solve2(n);
}

```