#include <bits/stdc++.h>
using namespace std;
int arr[131073];
void func(int n) {
  int p = 1;
  int r = 0;
  int x = 0;
  if (n == 0) return;
  while (n > (1 << p)) p++;
  x = (1 << p);
  r = x - n - 1;
  if (r == -1) {
    arr[n] = n - 1;
    arr[n - 1] = n;
    r = 1;
    n = n - 2;
  }
  for (int i = r; i <= n; ++i) arr[i] = n + r - i;
  func(r - 1);
}
int chk(int n) {
  int p = 1;
  while (n > (1 << p)) p++;
  if (n == (1 << p) || n < 6) return 0;
  return 1;
}
void fun(int n) {
  arr[1] = 3;
  arr[2] = 6;
  arr[3] = 1;
  arr[4] = 5;
  arr[5] = 4;
  arr[6] = 2;
  if (n >= 7) {
    arr[4] = 7;
    arr[7] = 5;
  } else
    return;
  for (int i = 8; i < n; i += 2) {
    arr[i] = i + 1;
    arr[i + 1] = i;
  }
  if (!(n & 1)) {
    int p = 0;
    while (1) {
      if (n & (1 << p)) {
        arr[n] = arr[(1 << p)];
        arr[(1 << p)] = n;
        return;
      }
      p++;
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  ;
  if (n & 1)
    cout << "NO" << endl;
  else {
    func(n);
    cout << "YES" << endl;
    for (int i = 1; i <= n; ++i) printf("%d ", arr[i]);
    printf("\n");
  }
  if (!chk(n))
    cout << "NO" << endl;
  else {
    fun(n);
    cout << "YES" << endl;
    for (int i = 1; i <= n; ++i) printf("%d ", arr[i]);
    printf("\n");
  }
  return 0;
}

### Prompt

Please provide a CPP coded solution 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;
int arr[131073];
void func(int n) {
  int p = 1;
  int r = 0;
  int x = 0;
  if (n == 0) return;
  while (n > (1 << p)) p++;
  x = (1 << p);
  r = x - n - 1;
  if (r == -1) {
    arr[n] = n - 1;
    arr[n - 1] = n;
    r = 1;
    n = n - 2;
  }
  for (int i = r; i <= n; ++i) arr[i] = n + r - i;
  func(r - 1);
}
int chk(int n) {
  int p = 1;
  while (n > (1 << p)) p++;
  if (n == (1 << p) || n < 6) return 0;
  return 1;
}
void fun(int n) {
  arr[1] = 3;
  arr[2] = 6;
  arr[3] = 1;
  arr[4] = 5;
  arr[5] = 4;
  arr[6] = 2;
  if (n >= 7) {
    arr[4] = 7;
    arr[7] = 5;
  } else
    return;
  for (int i = 8; i < n; i += 2) {
    arr[i] = i + 1;
    arr[i + 1] = i;
  }
  if (!(n & 1)) {
    int p = 0;
    while (1) {
      if (n & (1 << p)) {
        arr[n] = arr[(1 << p)];
        arr[(1 << p)] = n;
        return;
      }
      p++;
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  ;
  if (n & 1)
    cout << "NO" << endl;
  else {
    func(n);
    cout << "YES" << endl;
    for (int i = 1; i <= n; ++i) printf("%d ", arr[i]);
    printf("\n");
  }
  if (!chk(n))
    cout << "NO" << endl;
  else {
    fun(n);
    cout << "YES" << endl;
    for (int i = 1; i <= n; ++i) printf("%d ", arr[i]);
    printf("\n");
  }
  return 0;
}

```