#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n % 2) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    int m = 1;
    while ((1 << m) <= n) {
      m++;
    }
    vector<vector<int>> v(m + 1);
    v[1] = {2, 1};
    v[2] = {2, 1, 4, 3};
    for (int i = 3; i <= m; i++) {
      vector<int> vt(1 << i);
      int sz = (1 << i);
      for (int j = 0; j < sz; j++) {
        vt[j] = j + 1;
      }
      int sz2 = v[i - 1].size();
      for (int j = 0; j < sz2; j++) {
        vt[j] = v[i - 1][j];
        vt[j + sz2] = v[i - 1][j] + sz2;
      }
      for (int j = 0; j < sz2 - 2; j++) {
        swap(vt[j], vt[j + sz2]);
      }
      v[i] = vt;
    }
    int goal = n, pos = 0;
    vector<int> cur;
    while (goal) {
      while (!(goal & (1 << pos))) pos++;
      auto vt = v[pos];
      if (!cur.size()) {
        cur = vt;
      } else {
        vector<int> next(cur.size() + vt.size());
        for (int i = 0; i < vt.size(); i++) {
          if (vt[i] <= cur.size())
            next[i] = vt[i] + vt.size();
          else
            next[i] = vt[i];
        }
        for (int i = 0; i < cur.size(); i++) {
          next[i + vt.size()] = cur[i];
        }
        cur = next;
      }
      goal -= vt.size();
    }
    cout << endl;
    for (int i : cur) {
      cout << i << " ";
    }
    cout << endl;
  }
  if (n < 6 || __builtin_popcount(n) == 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  vector<int> cur = {3, 6, 2, 5, 1, 4};
  for (int i = 7; i <= n; i++) {
    if (__builtin_popcount(i) == 1) continue;
    if (__builtin_popcount(i - 1) == 1) {
      cur.push_back(i);
      cur.push_back(i - 1);
    } else {
      int p = 0;
      while (!(i & (1 << p))) p++;
      int pos = (1 << p) - 1;
      cur.push_back(cur[pos]);
      cur[pos] = i;
    }
  }
  for (int i : cur) {
    cout << i << " ";
  }
  return 0;
}

### Prompt

Please formulate a cpp solution to 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;
const long long MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  if (n % 2) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    int m = 1;
    while ((1 << m) <= n) {
      m++;
    }
    vector<vector<int>> v(m + 1);
    v[1] = {2, 1};
    v[2] = {2, 1, 4, 3};
    for (int i = 3; i <= m; i++) {
      vector<int> vt(1 << i);
      int sz = (1 << i);
      for (int j = 0; j < sz; j++) {
        vt[j] = j + 1;
      }
      int sz2 = v[i - 1].size();
      for (int j = 0; j < sz2; j++) {
        vt[j] = v[i - 1][j];
        vt[j + sz2] = v[i - 1][j] + sz2;
      }
      for (int j = 0; j < sz2 - 2; j++) {
        swap(vt[j], vt[j + sz2]);
      }
      v[i] = vt;
    }
    int goal = n, pos = 0;
    vector<int> cur;
    while (goal) {
      while (!(goal & (1 << pos))) pos++;
      auto vt = v[pos];
      if (!cur.size()) {
        cur = vt;
      } else {
        vector<int> next(cur.size() + vt.size());
        for (int i = 0; i < vt.size(); i++) {
          if (vt[i] <= cur.size())
            next[i] = vt[i] + vt.size();
          else
            next[i] = vt[i];
        }
        for (int i = 0; i < cur.size(); i++) {
          next[i + vt.size()] = cur[i];
        }
        cur = next;
      }
      goal -= vt.size();
    }
    cout << endl;
    for (int i : cur) {
      cout << i << " ";
    }
    cout << endl;
  }
  if (n < 6 || __builtin_popcount(n) == 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  vector<int> cur = {3, 6, 2, 5, 1, 4};
  for (int i = 7; i <= n; i++) {
    if (__builtin_popcount(i) == 1) continue;
    if (__builtin_popcount(i - 1) == 1) {
      cur.push_back(i);
      cur.push_back(i - 1);
    } else {
      int p = 0;
      while (!(i & (1 << p))) p++;
      int pos = (1 << p) - 1;
      cur.push_back(cur[pos]);
      cur[pos] = i;
    }
  }
  for (int i : cur) {
    cout << i << " ";
  }
  return 0;
}

```