#include <bits/stdc++.h>
using namespace std;
int p[100005], q[100005], n;
deque<int> v[17];
int main() {
  cin >> n;
  if (n & 1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    bitset<100005> vis;
    int k = n;
    for (int i = 0; i < 17; ++i)
      if (k & (1 << i) && k != (1 << i)) k -= (1 << i);
    while (vis.count() < n) {
      for (int i = 1; !vis[k + i - 1] && k + i - 1 <= n && k > i; ++i) {
        p[k - i] = k + i - 1, p[k + i - 1] = k - i;
        vis[k - i] = vis[k + i - 1] = true;
      }
      k /= 2;
    }
    for (int i = 1; i <= n; cout << p[i++] << ' ')
      ;
    cout << '\n';
  }
  if (!(n & (n - 1)) || n < 6)
    cout << "NO\n";
  else {
    cout << "YES\n";
    if (n == 6) {
      int a[6] = {1, 2, 3, 4, 5, 6};
      do {
        for (int i = 0; i < 6; ++i)
          if (i + 1 == a[i] || !((i + 1) & a[i])) goto end;
        for (int i = 0; i < 6; cout << a[i++] << ' ')
          ;
        break;
      end:;
      } while (next_permutation(a, a + 6));
    } else {
      int a[7] = {1, 2, 3, 4, 5, 6, 7};
      do {
        for (int i = 0; i < 7; ++i)
          if (i + 1 == a[i] || !((i + 1) & a[i])) goto end2;
        for (int i = 0; i < 7; cout << a[i++] << ' ')
          ;
        break;
      end2:;
      } while (next_permutation(a, a + 7));
      for (int k = 8; k < n; k *= 2) {
        for (int i = k + 1; i <= n && i < 2 * k; cout << i++ << ' ')
          ;
        cout << k << ' ';
      }
    }
  }
}

### Prompt

Create a solution in CPP for 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;
int p[100005], q[100005], n;
deque<int> v[17];
int main() {
  cin >> n;
  if (n & 1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    bitset<100005> vis;
    int k = n;
    for (int i = 0; i < 17; ++i)
      if (k & (1 << i) && k != (1 << i)) k -= (1 << i);
    while (vis.count() < n) {
      for (int i = 1; !vis[k + i - 1] && k + i - 1 <= n && k > i; ++i) {
        p[k - i] = k + i - 1, p[k + i - 1] = k - i;
        vis[k - i] = vis[k + i - 1] = true;
      }
      k /= 2;
    }
    for (int i = 1; i <= n; cout << p[i++] << ' ')
      ;
    cout << '\n';
  }
  if (!(n & (n - 1)) || n < 6)
    cout << "NO\n";
  else {
    cout << "YES\n";
    if (n == 6) {
      int a[6] = {1, 2, 3, 4, 5, 6};
      do {
        for (int i = 0; i < 6; ++i)
          if (i + 1 == a[i] || !((i + 1) & a[i])) goto end;
        for (int i = 0; i < 6; cout << a[i++] << ' ')
          ;
        break;
      end:;
      } while (next_permutation(a, a + 6));
    } else {
      int a[7] = {1, 2, 3, 4, 5, 6, 7};
      do {
        for (int i = 0; i < 7; ++i)
          if (i + 1 == a[i] || !((i + 1) & a[i])) goto end2;
        for (int i = 0; i < 7; cout << a[i++] << ' ')
          ;
        break;
      end2:;
      } while (next_permutation(a, a + 7));
      for (int k = 8; k < n; k *= 2) {
        for (int i = k + 1; i <= n && i < 2 * k; cout << i++ << ' ')
          ;
        cout << k << ' ';
      }
    }
  }
}

```