#include <bits/stdc++.h>
using namespace std;
bool is_power_of_two(int num) {
  while (num % 2 == 0) {
    num /= 2;
  }
  return num == 1;
}
int main() {
  int length;
  cin >> length;
  if (length % 2 == 1) {
    cout << "NO" << endl;
  } else {
    vector<int> match(length + 1, 0);
    for (int k = 1 << 25; k != 1; k /= 2) {
      for (int j = 0; ((k + j <= length) && (k - j - 1 >= 1) &&
                       (match[k + j] == 0) && (match[k - j - 1] == 0));
           j++) {
        match[k + j] = k - j - 1;
        match[k - j - 1] = k + j;
      }
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  }
  if (length < 6) {
    cout << "NO" << endl;
  } else if (is_power_of_two(length)) {
    cout << "NO" << endl;
  } else if (length % 2 == 0) {
    vector<int> numbers;
    for (int i = 2; i <= length; i++) {
      if (i != length - 1) {
        numbers.push_back(i);
      }
    }
    vector<int> match(length + 1, 0);
    match[1] = length - 1;
    match[length - 1] = 1;
    for (int i = 0; i < (int)numbers.size(); i += 2) {
      match[numbers[i]] = numbers[i + 1];
      match[numbers[i + 1]] = numbers[i];
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  } else if (length % 2 == 1) {
    vector<int> match(length + 1, 0);
    match[1] = 3;
    match[2] = 6;
    match[3] = 7;
    match[4] = 5;
    match[5] = 4;
    match[6] = 2;
    match[7] = 1;
    for (int i = 8; i <= length; i += 2) {
      match[i] = i + 1;
      match[i + 1] = i;
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  }
}

### Prompt

Construct a cpp code solution to the problem outlined:

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;
bool is_power_of_two(int num) {
  while (num % 2 == 0) {
    num /= 2;
  }
  return num == 1;
}
int main() {
  int length;
  cin >> length;
  if (length % 2 == 1) {
    cout << "NO" << endl;
  } else {
    vector<int> match(length + 1, 0);
    for (int k = 1 << 25; k != 1; k /= 2) {
      for (int j = 0; ((k + j <= length) && (k - j - 1 >= 1) &&
                       (match[k + j] == 0) && (match[k - j - 1] == 0));
           j++) {
        match[k + j] = k - j - 1;
        match[k - j - 1] = k + j;
      }
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  }
  if (length < 6) {
    cout << "NO" << endl;
  } else if (is_power_of_two(length)) {
    cout << "NO" << endl;
  } else if (length % 2 == 0) {
    vector<int> numbers;
    for (int i = 2; i <= length; i++) {
      if (i != length - 1) {
        numbers.push_back(i);
      }
    }
    vector<int> match(length + 1, 0);
    match[1] = length - 1;
    match[length - 1] = 1;
    for (int i = 0; i < (int)numbers.size(); i += 2) {
      match[numbers[i]] = numbers[i + 1];
      match[numbers[i + 1]] = numbers[i];
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  } else if (length % 2 == 1) {
    vector<int> match(length + 1, 0);
    match[1] = 3;
    match[2] = 6;
    match[3] = 7;
    match[4] = 5;
    match[5] = 4;
    match[6] = 2;
    match[7] = 1;
    for (int i = 8; i <= length; i += 2) {
      match[i] = i + 1;
      match[i + 1] = i;
    }
    cout << "YES" << endl;
    for (int i = 1; i <= length; i++) {
      cout << match[i] << ' ';
    }
    cout << endl;
  }
}

```