#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 5;
int N;
int p[MAXN], q[MAXN];
void subtask1() {
  if (N & 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    int x = N;
    while (x != 0) {
      int i = 1 << (32 - __builtin_clz(x) - 1);
      int j = i - 1;
      while (i <= x) {
        p[i] = j;
        p[j] = i;
        j--;
        i++;
      }
      x = j;
    }
    for (int i = 1; i <= N; ++i) cout << p[i] << " ";
    cout << endl;
  }
}
void subtask2() {
  if (N <= 5 || __builtin_popcount(N) == 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    p[1] = 3, p[2] = 6, p[3] = 2, p[4] = 5, p[5] = 1, p[6] = 4;
    for (int i = 7; i <= N; ++i) {
      if (__builtin_popcount(i) == 1) {
        p[i] = i;
      } else {
        int temp = p[1 << (32 - __builtin_clz(i) - 1)];
        p[1 << (32 - __builtin_clz(i) - 1)] = i;
        p[i] = temp;
      }
    }
    for (int i = 1; i <= N; ++i) cout << p[i] << " ";
    cout << endl;
  }
}
int main() {
  cin >> N;
  subtask1();
  subtask2();
  return 0;
}

### Prompt

In cpp, your task is to solve 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;
using ll = long long;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 5;
int N;
int p[MAXN], q[MAXN];
void subtask1() {
  if (N & 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    int x = N;
    while (x != 0) {
      int i = 1 << (32 - __builtin_clz(x) - 1);
      int j = i - 1;
      while (i <= x) {
        p[i] = j;
        p[j] = i;
        j--;
        i++;
      }
      x = j;
    }
    for (int i = 1; i <= N; ++i) cout << p[i] << " ";
    cout << endl;
  }
}
void subtask2() {
  if (N <= 5 || __builtin_popcount(N) == 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    p[1] = 3, p[2] = 6, p[3] = 2, p[4] = 5, p[5] = 1, p[6] = 4;
    for (int i = 7; i <= N; ++i) {
      if (__builtin_popcount(i) == 1) {
        p[i] = i;
      } else {
        int temp = p[1 << (32 - __builtin_clz(i) - 1)];
        p[1 << (32 - __builtin_clz(i) - 1)] = i;
        p[i] = temp;
      }
    }
    for (int i = 1; i <= N; ++i) cout << p[i] << " ";
    cout << endl;
  }
}
int main() {
  cin >> N;
  subtask1();
  subtask2();
  return 0;
}

```