#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int b[maxn];
void getans(int t) {
  if (t == 0) return;
  int temp = 1;
  while (temp <= t) temp <<= 1;
  temp >>= 1;
  int cnt = t - temp + 1;
  for (int i = 1; i <= cnt; ++i) {
    a[temp + i - 1] = temp - i;
    a[temp - i] = temp + i - 1;
  }
  getans(temp - cnt - 1);
}
inline int lowbit(int t) { return t & (-t); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, j, k, m, n;
  cin >> n;
  if (n & 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    getans(n);
    for (int i = 1; i <= n; ++i) cout << a[i] << " ";
    cout << endl;
  }
  double ta = log2(n);
  int tb = ta;
  if (n < 6 || (n >= 8 && tb == ta))
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    if (n == 6)
      cout << "3 6 2 5 1 4" << endl;
    else {
      b[1] = 5, b[5] = 1, b[4] = 6, b[6] = 4, b[2] = 3, b[3] = 7, b[7] = 2;
      int ed = 8;
      for (int i = 8; i <= n; i = ed) {
        ed += lowbit(i);
        ed = min(ed, n + 1);
        for (int j = i; j < ed - 1; ++j) b[j] = j + 1;
        b[ed - 1] = i;
      }
      for (int i = 1; i <= n; ++i) cout << b[i] << " ";
      cout << endl;
    }
  }
  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;
const int maxn = 1e5 + 5;
int a[maxn];
int b[maxn];
void getans(int t) {
  if (t == 0) return;
  int temp = 1;
  while (temp <= t) temp <<= 1;
  temp >>= 1;
  int cnt = t - temp + 1;
  for (int i = 1; i <= cnt; ++i) {
    a[temp + i - 1] = temp - i;
    a[temp - i] = temp + i - 1;
  }
  getans(temp - cnt - 1);
}
inline int lowbit(int t) { return t & (-t); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int i, j, k, m, n;
  cin >> n;
  if (n & 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    getans(n);
    for (int i = 1; i <= n; ++i) cout << a[i] << " ";
    cout << endl;
  }
  double ta = log2(n);
  int tb = ta;
  if (n < 6 || (n >= 8 && tb == ta))
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    if (n == 6)
      cout << "3 6 2 5 1 4" << endl;
    else {
      b[1] = 5, b[5] = 1, b[4] = 6, b[6] = 4, b[2] = 3, b[3] = 7, b[7] = 2;
      int ed = 8;
      for (int i = 8; i <= n; i = ed) {
        ed += lowbit(i);
        ed = min(ed, n + 1);
        for (int j = i; j < ed - 1; ++j) b[j] = j + 1;
        b[ed - 1] = i;
      }
      for (int i = 1; i <= n; ++i) cout << b[i] << " ";
      cout << endl;
    }
  }
  return 0;
}

```