#include <bits/stdc++.h>
using namespace std;
vector<int> first;
bool f(int x) {
  int m = 1;
  while (m * 2 <= x) {
    m *= 2;
  }
  if (x - m + 1 > m - 1) return false;
  int up = m;
  int down = m - 1;
  while (up <= x) {
    first[up - 1] = down;
    first[down - 1] = up;
    up++;
    down--;
  }
  if (down > 0) {
    return f(down);
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  first.resize(n);
  if (f(n)) {
    cout << "YES" << endl;
    for (auto x : first) cout << x << ' ';
    cout << endl;
  } else
    cout << "NO" << '\n';
  if (n <= 5 || __builtin_popcount(n) == 1) {
    cout << "NO" << '\n';
  } else if (n == 6) {
    cout << "YES" << '\n';
    cout << "5 3 2 6 1 4" << endl;
  } else if (n >= 7) {
    cout << "YES" << endl;
    cout << "5 3 2 6 1 7 4 ";
    vector<vector<int>> v(32);
    for (int i = 8; i <= n; i++) {
      v[32 - __builtin_clz(i)].push_back(i);
    }
    for (auto& vv : v) {
      for (int i = 0; i < (int)vv.size(); i++) {
        cout << vv[(i + 1) % vv.size()] << ' ';
      }
    }
    cout << endl;
  }
}

### Prompt

Your task is to create 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;
vector<int> first;
bool f(int x) {
  int m = 1;
  while (m * 2 <= x) {
    m *= 2;
  }
  if (x - m + 1 > m - 1) return false;
  int up = m;
  int down = m - 1;
  while (up <= x) {
    first[up - 1] = down;
    first[down - 1] = up;
    up++;
    down--;
  }
  if (down > 0) {
    return f(down);
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  first.resize(n);
  if (f(n)) {
    cout << "YES" << endl;
    for (auto x : first) cout << x << ' ';
    cout << endl;
  } else
    cout << "NO" << '\n';
  if (n <= 5 || __builtin_popcount(n) == 1) {
    cout << "NO" << '\n';
  } else if (n == 6) {
    cout << "YES" << '\n';
    cout << "5 3 2 6 1 4" << endl;
  } else if (n >= 7) {
    cout << "YES" << endl;
    cout << "5 3 2 6 1 7 4 ";
    vector<vector<int>> v(32);
    for (int i = 8; i <= n; i++) {
      v[32 - __builtin_clz(i)].push_back(i);
    }
    for (auto& vv : v) {
      for (int i = 0; i < (int)vv.size(); i++) {
        cout << vv[(i + 1) % vv.size()] << ' ';
      }
    }
    cout << endl;
  }
}

```