#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n & 1) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    vector<int> a(n);
    for (int i = 0; i < n; i++) a[i] = i + 1;
    int m = n;
    while (m) {
      int c = 1;
      while (c <= m) c *= 2;
      c /= 2;
      for (int i = c - 1; i < m; i++) {
        swap(a[i], a[2 * c - 3 - i]);
      }
      m -= 2 * (m - c) + 2;
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
  int c = 1;
  while (c < n) c *= 2;
  if (n == c || n < 6) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    vector<int> a(n);
    vector<vector<int>> ta(20);
    int bit = 0, d = 1;
    for (int i = 1; i <= n; i++) {
      if (d * 2 <= i) d *= 2, bit++;
      if (i == 5)
        ta[0].push_back(i);
      else
        ta[bit].push_back(i);
    }
    for (int i = 0; i < 20; i++) {
      int sz = ta[i].size();
      for (int j = 0; j < sz; j++) {
        a[ta[i][j] - 1] = ta[i][(j + 1) % sz];
      }
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}

### Prompt

Generate 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;
int main() {
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n & 1) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    vector<int> a(n);
    for (int i = 0; i < n; i++) a[i] = i + 1;
    int m = n;
    while (m) {
      int c = 1;
      while (c <= m) c *= 2;
      c /= 2;
      for (int i = c - 1; i < m; i++) {
        swap(a[i], a[2 * c - 3 - i]);
      }
      m -= 2 * (m - c) + 2;
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
  int c = 1;
  while (c < n) c *= 2;
  if (n == c || n < 6) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    vector<int> a(n);
    vector<vector<int>> ta(20);
    int bit = 0, d = 1;
    for (int i = 1; i <= n; i++) {
      if (d * 2 <= i) d *= 2, bit++;
      if (i == 5)
        ta[0].push_back(i);
      else
        ta[bit].push_back(i);
    }
    for (int i = 0; i < 20; i++) {
      int sz = ta[i].size();
      for (int j = 0; j < sz; j++) {
        a[ta[i][j] - 1] = ta[i][(j + 1) % sz];
      }
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}

```