#include <bits/stdc++.h>
using namespace std;
vector<int> same_bit(int n) {
  if (n <= 5 || n - (n & -n) == 0) return {-1};
  map<int, vector<int>> biti;
  vector<int> ans = {0};
  for (int i(1); i <= n; i++) ans.push_back(i);
  ans[1] = 5, ans[5] = 1;
  ans[2] = 3, ans[3] = 2;
  biti[1].push_back(4);
  for (int i(6), sz(1); i <= n; i++) {
    if (i - (i & -i) == 0) sz++;
    biti[sz].push_back(i);
  }
  for (auto v : biti) {
    for (int j(0); j < v.second.size() - 1; j++)
      ans[v.second[j]] = v.second[j + 1];
    ans[v.second.back()] = v.second[0];
  }
  return ans;
}
int cuplat[100010];
void dif_bit(int n, int bitmax) {
  if (n == 0) return;
  while ((1 << bitmax) > n) bitmax--;
  int cnt = (1 << bitmax) - 1, all = (1 << (bitmax + 1)) - 1;
  for (int i(1 << bitmax); i <= n; i++) {
    cuplat[i] = i ^ all;
    cuplat[i ^ all] = i;
    cnt--;
  }
  dif_bit(cnt, bitmax - 1);
}
int main() {
  int n;
  cin >> n;
  if (n & 1)
    cout << "NO\n";
  else {
    dif_bit(n, 20);
    cout << "YES\n";
    for (int i(1); i <= n; i++) {
      cout << cuplat[i] << ' ';
    }
    cout << '\n';
  }
  vector<int> v = same_bit(n);
  if (v[0] == -1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i(1); i <= n; i++) cout << v[i] << ' ';
    cout << '\n';
  }
  return 0;
}

### 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;
vector<int> same_bit(int n) {
  if (n <= 5 || n - (n & -n) == 0) return {-1};
  map<int, vector<int>> biti;
  vector<int> ans = {0};
  for (int i(1); i <= n; i++) ans.push_back(i);
  ans[1] = 5, ans[5] = 1;
  ans[2] = 3, ans[3] = 2;
  biti[1].push_back(4);
  for (int i(6), sz(1); i <= n; i++) {
    if (i - (i & -i) == 0) sz++;
    biti[sz].push_back(i);
  }
  for (auto v : biti) {
    for (int j(0); j < v.second.size() - 1; j++)
      ans[v.second[j]] = v.second[j + 1];
    ans[v.second.back()] = v.second[0];
  }
  return ans;
}
int cuplat[100010];
void dif_bit(int n, int bitmax) {
  if (n == 0) return;
  while ((1 << bitmax) > n) bitmax--;
  int cnt = (1 << bitmax) - 1, all = (1 << (bitmax + 1)) - 1;
  for (int i(1 << bitmax); i <= n; i++) {
    cuplat[i] = i ^ all;
    cuplat[i ^ all] = i;
    cnt--;
  }
  dif_bit(cnt, bitmax - 1);
}
int main() {
  int n;
  cin >> n;
  if (n & 1)
    cout << "NO\n";
  else {
    dif_bit(n, 20);
    cout << "YES\n";
    for (int i(1); i <= n; i++) {
      cout << cuplat[i] << ' ';
    }
    cout << '\n';
  }
  vector<int> v = same_bit(n);
  if (v[0] == -1)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i(1); i <= n; i++) cout << v[i] << ' ';
    cout << '\n';
  }
  return 0;
}

```