#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
inline long long gl() {
  long long f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int INF = 0x3f3f3f3f, N = 100003, M = N << 1;
int n, a[N], tot, lg[N];
void solve(int x) {
  if (x <= 1) return;
  int r = 1 << lg[x];
  for (int i = 0; i <= x - r; i += 1)
    if (r - i - 1 >= 1)
      a[r + i] = r - i - 1, a[r - i - 1] = r + i;
    else
      break;
  solve(r - (x - r) - 2);
}
int main() {
  n = gi();
  for (int i = 1; i <= n; i += 1) a[i] = i;
  lg[0] = -1;
  for (int i = 1; i <= n; i += 1) lg[i] = lg[i >> 1] + 1;
  if (n & 1)
    puts("NO");
  else {
    solve(n);
    puts("YES");
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
    puts("");
  }
  if ((1 << lg[n]) == n) {
    puts("NO");
    return 0;
  }
  if (n <= 7) {
    bool ok = false;
    for (int i = 1; i <= n; i += 1) a[i] = i;
    do {
      bool fl = true;
      for (int i = 1; i <= n; i += 1)
        if (a[i] == i || (a[i] & i) == 0) fl = false;
      if (fl) {
        ok = true;
        break;
      }
    } while (next_permutation(a + 1, a + 1 + n));
    if (!ok)
      puts("NO");
    else {
      puts("YES");
      for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
    }
    return 0;
  }
  for (int i = 1; i <= n; i += 1) a[i] = i;
  for (int i = 2; i <= n; i += 2)
    if (i + 1 <= n) swap(a[i], a[i + 1]);
  if (n & 1) {
    a[1] = 3, a[2] = 6, a[3] = 1, a[4] = 5, a[5] = 4, a[6] = 7, a[7] = 2;
    puts("YES");
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
  } else {
    puts("YES");
    a[1] = n - 1, a[n - 2] = n, a[n - 1] = 1, a[n] = n - 2;
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
  }
  return 0;
}

### Prompt

Develop a solution in Cpp to the problem described below:

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;
inline int gi() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
inline long long gl() {
  long long f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int INF = 0x3f3f3f3f, N = 100003, M = N << 1;
int n, a[N], tot, lg[N];
void solve(int x) {
  if (x <= 1) return;
  int r = 1 << lg[x];
  for (int i = 0; i <= x - r; i += 1)
    if (r - i - 1 >= 1)
      a[r + i] = r - i - 1, a[r - i - 1] = r + i;
    else
      break;
  solve(r - (x - r) - 2);
}
int main() {
  n = gi();
  for (int i = 1; i <= n; i += 1) a[i] = i;
  lg[0] = -1;
  for (int i = 1; i <= n; i += 1) lg[i] = lg[i >> 1] + 1;
  if (n & 1)
    puts("NO");
  else {
    solve(n);
    puts("YES");
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
    puts("");
  }
  if ((1 << lg[n]) == n) {
    puts("NO");
    return 0;
  }
  if (n <= 7) {
    bool ok = false;
    for (int i = 1; i <= n; i += 1) a[i] = i;
    do {
      bool fl = true;
      for (int i = 1; i <= n; i += 1)
        if (a[i] == i || (a[i] & i) == 0) fl = false;
      if (fl) {
        ok = true;
        break;
      }
    } while (next_permutation(a + 1, a + 1 + n));
    if (!ok)
      puts("NO");
    else {
      puts("YES");
      for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
    }
    return 0;
  }
  for (int i = 1; i <= n; i += 1) a[i] = i;
  for (int i = 2; i <= n; i += 2)
    if (i + 1 <= n) swap(a[i], a[i + 1]);
  if (n & 1) {
    a[1] = 3, a[2] = 6, a[3] = 1, a[4] = 5, a[5] = 4, a[6] = 7, a[7] = 2;
    puts("YES");
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
  } else {
    puts("YES");
    a[1] = n - 1, a[n - 2] = n, a[n - 1] = 1, a[n] = n - 2;
    for (int i = 1; i <= n; i += 1) printf("%d ", a[i]);
  }
  return 0;
}

```