#include <bits/stdc++.h>
using namespace std;
vector<int> solve_zero(int N) {
  if (N % 2 == 1) return vector<int>{};
  vector<int> A(N, 0);
  while (N >= 2) {
    int D = 0;
    for (int i = 1; i < 20; i++) {
      if ((1 << i) - 2 >= N) {
        D = (1 << i) - 2;
        break;
      }
    }
    for (int i = D - N + 1; i <= N; i++) A[i - 1] = D + 1 - i;
    N = D - N;
  }
  return A;
}
vector<int> solve_nonzero(int N) {
  if (N <= 5) return vector<int>{};
  if (N == 6) return vector<int>{3, 6, 1, 5, 4, 2};
  vector<int> A(N, 0);
  while (true) {
    if (N == 7) {
      A[0] = 3;
      A[1] = 6;
      A[2] = 7;
      A[3] = 5;
      A[4] = 4;
      A[5] = 2;
      A[6] = 1;
      break;
    }
    int D = 0;
    for (int i = 0; i < 20; i++) {
      if (N >= (1 << i)) D = (1 << i);
    }
    if (D == N) return vector<int>{};
    for (int i = D; i <= N; i++) A[i - 1] = (((i - D) + 1) % (N - D + 1)) + D;
    N = D - 1;
  }
  return A;
}
int main() {
  int T;
  cin >> T;
  vector<int> E1 = solve_zero(T);
  vector<int> E2 = solve_nonzero(T);
  if (E1.size() == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < E1.size(); i++) {
      if (i) printf(" ");
      printf("%d", E1[i]);
    }
    printf("\n");
  }
  if (E2.size() == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < E2.size(); i++) {
      if (i) printf(" ");
      printf("%d", E2[i]);
    }
    printf("\n");
  }
  return 0;
}

### 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> solve_zero(int N) {
  if (N % 2 == 1) return vector<int>{};
  vector<int> A(N, 0);
  while (N >= 2) {
    int D = 0;
    for (int i = 1; i < 20; i++) {
      if ((1 << i) - 2 >= N) {
        D = (1 << i) - 2;
        break;
      }
    }
    for (int i = D - N + 1; i <= N; i++) A[i - 1] = D + 1 - i;
    N = D - N;
  }
  return A;
}
vector<int> solve_nonzero(int N) {
  if (N <= 5) return vector<int>{};
  if (N == 6) return vector<int>{3, 6, 1, 5, 4, 2};
  vector<int> A(N, 0);
  while (true) {
    if (N == 7) {
      A[0] = 3;
      A[1] = 6;
      A[2] = 7;
      A[3] = 5;
      A[4] = 4;
      A[5] = 2;
      A[6] = 1;
      break;
    }
    int D = 0;
    for (int i = 0; i < 20; i++) {
      if (N >= (1 << i)) D = (1 << i);
    }
    if (D == N) return vector<int>{};
    for (int i = D; i <= N; i++) A[i - 1] = (((i - D) + 1) % (N - D + 1)) + D;
    N = D - 1;
  }
  return A;
}
int main() {
  int T;
  cin >> T;
  vector<int> E1 = solve_zero(T);
  vector<int> E2 = solve_nonzero(T);
  if (E1.size() == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < E1.size(); i++) {
      if (i) printf(" ");
      printf("%d", E1[i]);
    }
    printf("\n");
  }
  if (E2.size() == 0)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < E2.size(); i++) {
      if (i) printf(" ");
      printf("%d", E2[i]);
    }
    printf("\n");
  }
  return 0;
}

```