#include <bits/stdc++.h>
using namespace std;
long long int n, a1[100005], ans[100005];
bool isp2(long long int n) { return __builtin_popcountll(n) == 1; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  if (n % 2) {
    cout << "NO\n";
  } else {
    long long int en = n;
    while (en) {
      long long int p2 = 1;
      while (p2 <= en) p2 *= 2;
      long long int cur = p2 - 1 - en;
      for (long long int i = en; i >= 1; i--) {
        a1[i] = cur;
        cur++;
        if (cur > en) {
          en = i - 1;
          break;
        }
      }
    }
    cout << "YES\n";
    for (long long int i = 1; i <= n; ++i) cout << a1[i] << " ";
    cout << '\n';
  }
  if (n <= 5 || isp2(n))
    cout << "NO\n";
  else {
    vector<long long int> req;
    long long int jmp = 2;
    for (long long int i = 1; i <= n; ++i)
      if (!ans[i]) {
        vector<long long int> cur;
        for (long long int j = i; j <= n; j += jmp) cur.push_back(j);
        if (cur.size() == 1) {
          req.push_back(i);
        } else {
          for (long long int j = 0; j <= cur.size() - 2; ++j)
            ans[cur[j]] = cur[j + 1];
          ans[cur.back()] = cur[0];
        }
        jmp *= 2;
      }
    for (long long int v : req) {
      if (v + 3 <= n) {
        ans[v + 1] = v;
        ans[v] = v + 3;
      } else {
        ans[v - 1] = 1;
        ans[v] = v + 1;
        ans[v + 1] = v;
      }
    }
    cout << "YES\n";
    for (long long int i = 1; i <= n; ++i) cout << ans[i] << " ";
    cout << '\n';
  }
}

### 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;
long long int n, a1[100005], ans[100005];
bool isp2(long long int n) { return __builtin_popcountll(n) == 1; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  if (n % 2) {
    cout << "NO\n";
  } else {
    long long int en = n;
    while (en) {
      long long int p2 = 1;
      while (p2 <= en) p2 *= 2;
      long long int cur = p2 - 1 - en;
      for (long long int i = en; i >= 1; i--) {
        a1[i] = cur;
        cur++;
        if (cur > en) {
          en = i - 1;
          break;
        }
      }
    }
    cout << "YES\n";
    for (long long int i = 1; i <= n; ++i) cout << a1[i] << " ";
    cout << '\n';
  }
  if (n <= 5 || isp2(n))
    cout << "NO\n";
  else {
    vector<long long int> req;
    long long int jmp = 2;
    for (long long int i = 1; i <= n; ++i)
      if (!ans[i]) {
        vector<long long int> cur;
        for (long long int j = i; j <= n; j += jmp) cur.push_back(j);
        if (cur.size() == 1) {
          req.push_back(i);
        } else {
          for (long long int j = 0; j <= cur.size() - 2; ++j)
            ans[cur[j]] = cur[j + 1];
          ans[cur.back()] = cur[0];
        }
        jmp *= 2;
      }
    for (long long int v : req) {
      if (v + 3 <= n) {
        ans[v + 1] = v;
        ans[v] = v + 3;
      } else {
        ans[v - 1] = 1;
        ans[v] = v + 1;
        ans[v + 1] = v;
      }
    }
    cout << "YES\n";
    for (long long int i = 1; i <= n; ++i) cout << ans[i] << " ";
    cout << '\n';
  }
}

```