#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e5 + 5;
int n, ans[Nmax];
void solve1() {
  if (n & 1) {
    cout << "NO\n";
    return;
  };
  int p, i, nn = n;
  cout << "YES\n";
  while (nn) {
    for (p = 0; (1 << p) <= nn; ++p)
      ;
    --p;
    for (i = 1; i <= nn - (1 << p) + 1; ++i)
      ans[(1 << p) - i] = (1 << p) + i - 1,
                     ans[(1 << p) + i - 1] = (1 << p) - i;
    nn = (1 << (p + 1)) - nn - 2;
  }
  for (i = 1; i <= n; ++i) cout << ans[i] << ' ';
  cout << '\n';
}
void solve2() {
  if (n <= 5) {
    cout << "NO\n";
    return;
  };
  int p, i, j;
  for (p = 0; (1 << p) <= n; ++p)
    ;
  --p;
  if ((1 << p) == n) {
    cout << "NO\n";
    return;
  };
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  if ((1 << (p + 1)) - 1 == n) ++p;
  for (i = (1 << p); i <= n; ++i) ans[i] = i + 1;
  ans[n] = (1 << p);
  for (i = 0; i < p - 3; ++i) {
    for (j = 1; (j << i) < (1 << p); j += 2) ans[j << i] = ((j + 2) << i);
    j -= 2;
    ans[j << i] = (1 << i);
  }
  ans[1 << i] = 3 << i;
  ans[3 << i] = 2 << i;
  ans[2 << i] = 6 << i;
  ans[6 << i] = 4 << i;
  ans[4 << i] = 5 << i;
  ans[5 << i] = 7 << i;
  ans[7 << i] = 1 << i;
  for (i = 1; i <= n; ++i) cout << ans[i] << ' ';
  cout << '\n';
}
int main() {
  cin >> n;
  solve1();
  solve2();
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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;
const int Nmax = 1e5 + 5;
int n, ans[Nmax];
void solve1() {
  if (n & 1) {
    cout << "NO\n";
    return;
  };
  int p, i, nn = n;
  cout << "YES\n";
  while (nn) {
    for (p = 0; (1 << p) <= nn; ++p)
      ;
    --p;
    for (i = 1; i <= nn - (1 << p) + 1; ++i)
      ans[(1 << p) - i] = (1 << p) + i - 1,
                     ans[(1 << p) + i - 1] = (1 << p) - i;
    nn = (1 << (p + 1)) - nn - 2;
  }
  for (i = 1; i <= n; ++i) cout << ans[i] << ' ';
  cout << '\n';
}
void solve2() {
  if (n <= 5) {
    cout << "NO\n";
    return;
  };
  int p, i, j;
  for (p = 0; (1 << p) <= n; ++p)
    ;
  --p;
  if ((1 << p) == n) {
    cout << "NO\n";
    return;
  };
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  if ((1 << (p + 1)) - 1 == n) ++p;
  for (i = (1 << p); i <= n; ++i) ans[i] = i + 1;
  ans[n] = (1 << p);
  for (i = 0; i < p - 3; ++i) {
    for (j = 1; (j << i) < (1 << p); j += 2) ans[j << i] = ((j + 2) << i);
    j -= 2;
    ans[j << i] = (1 << i);
  }
  ans[1 << i] = 3 << i;
  ans[3 << i] = 2 << i;
  ans[2 << i] = 6 << i;
  ans[6 << i] = 4 << i;
  ans[4 << i] = 5 << i;
  ans[5 << i] = 7 << i;
  ans[7 << i] = 1 << i;
  for (i = 1; i <= n; ++i) cout << ans[i] << ' ';
  cout << '\n';
}
int main() {
  cin >> n;
  solve1();
  solve2();
  return 0;
}

```