#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
const ll MODBASE = 1000000007LL;
const int MAXN = 100010;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;
int res1[MAXN], res2[MAXN];
void process(int n) {
  if (n <= 0) return;
  int u = 0;
  while ((1 << u) <= n) u++;
  u--;
  int i = 1;
  while ((1 << u) + i - 1 <= n) {
    res1[(1 << u) + i - 1] = (1 << u) - i;
    res1[(1 << u) - i] = (1 << u) + i - 1;
    i++;
  }
  process((1 << u) - i);
}
void solve1(int n) {
  if (n % 2) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  process(n);
  for (int i = (1); i <= (n); i++) cout << res1[i] << ' ';
  cout << "\n";
}
void solve2(int n) {
  if (n <= 5) {
    cout << "NO\n";
    return;
  }
  int u = 0;
  while ((1 << u) <= n) u++;
  u--;
  if ((1 << u) == n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  if (n == 7) {
    cout << "7 3 6 5 1 2 4\n";
    return;
  }
  cout << "7 3 6 5 1 2 4 ";
  for (int i = (3); i <= (u); i++) {
    int last = min(n, (1 << (i + 1)) - 1);
    int x = (1 << i);
    for (int j = (x); j <= (last); j++) {
      int p = j + 1;
      if (p > last) p = x;
      cout << p << ' ';
    }
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  solve1(n);
  solve2(n);
  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;
using ll = long long;
using ld = double;
const ll MODBASE = 1000000007LL;
const int MAXN = 100010;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;
int res1[MAXN], res2[MAXN];
void process(int n) {
  if (n <= 0) return;
  int u = 0;
  while ((1 << u) <= n) u++;
  u--;
  int i = 1;
  while ((1 << u) + i - 1 <= n) {
    res1[(1 << u) + i - 1] = (1 << u) - i;
    res1[(1 << u) - i] = (1 << u) + i - 1;
    i++;
  }
  process((1 << u) - i);
}
void solve1(int n) {
  if (n % 2) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  process(n);
  for (int i = (1); i <= (n); i++) cout << res1[i] << ' ';
  cout << "\n";
}
void solve2(int n) {
  if (n <= 5) {
    cout << "NO\n";
    return;
  }
  int u = 0;
  while ((1 << u) <= n) u++;
  u--;
  if ((1 << u) == n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  if (n == 7) {
    cout << "7 3 6 5 1 2 4\n";
    return;
  }
  cout << "7 3 6 5 1 2 4 ";
  for (int i = (3); i <= (u); i++) {
    int last = min(n, (1 << (i + 1)) - 1);
    int x = (1 << i);
    for (int j = (x); j <= (last); j++) {
      int p = j + 1;
      if (p > last) p = x;
      cout << p << ' ';
    }
  }
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  solve1(n);
  solve2(n);
  return 0;
}

```