#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int c[] = {3, 6, 2, 5, 1, 4};
int d[] = {7, 3, 6, 5, 1, 2, 4};
void solve_zero(int n) {
  int z = 1, next = n;
  while (z * 2 <= n) z *= 2;
  for (int i = 1; z + i - 1 <= n; ++i) {
    a[z - i] = z + i - 1;
    a[z + i - 1] = z - i;
    next = z - i - 1;
  }
  if (next <= 0) return;
  solve_zero(next);
}
int main() {
  scanf("%d", &n);
  if (n % 2)
    puts("NO");
  else {
    solve_zero(n);
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
    puts("");
  }
  int z = 1;
  while (z < n) z *= 2;
  if (n <= 5 || z == n) {
    puts("NO");
    return 0;
  }
  puts("YES");
  if (n == 6 || n == 7) {
    for (int i = 0; i < n; ++i) printf("%d ", (n == 6 ? c[i] : d[i]));
    return 0;
  }
  for (int i = 0; i < 7; ++i) printf("%d ", d[i]);
  z = 8;
  for (int i = 8; i <= n; ++i) {
    if (i == z) {
      z *= 2;
      printf("%d ", min(n, z - 1));
    } else
      printf("%d ", i - 1);
  }
  return 0;
}

### Prompt

Generate 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;
int n;
int a[100005];
int c[] = {3, 6, 2, 5, 1, 4};
int d[] = {7, 3, 6, 5, 1, 2, 4};
void solve_zero(int n) {
  int z = 1, next = n;
  while (z * 2 <= n) z *= 2;
  for (int i = 1; z + i - 1 <= n; ++i) {
    a[z - i] = z + i - 1;
    a[z + i - 1] = z - i;
    next = z - i - 1;
  }
  if (next <= 0) return;
  solve_zero(next);
}
int main() {
  scanf("%d", &n);
  if (n % 2)
    puts("NO");
  else {
    solve_zero(n);
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
    puts("");
  }
  int z = 1;
  while (z < n) z *= 2;
  if (n <= 5 || z == n) {
    puts("NO");
    return 0;
  }
  puts("YES");
  if (n == 6 || n == 7) {
    for (int i = 0; i < n; ++i) printf("%d ", (n == 6 ? c[i] : d[i]));
    return 0;
  }
  for (int i = 0; i < 7; ++i) printf("%d ", d[i]);
  z = 8;
  for (int i = 8; i <= n; ++i) {
    if (i == z) {
      z *= 2;
      printf("%d ", min(n, z - 1));
    } else
      printf("%d ", i - 1);
  }
  return 0;
}

```