#include <bits/stdc++.h>
using namespace std;
int ar[1000000], mapping[1000000];
void constructP(int n) {
  if (n & 1) {
    printf("NO\n");
  } else {
    printf("YES\n");
    int in = n;
    while (n > 0) {
      if (n == 2) {
        ar[1] = 2;
        ar[2] = 1;
        break;
      } else {
        int g = 1;
        while (g * 2 <= n) {
          g *= 2;
        }
        int mini = 0;
        for (int i = 1; g + i - 1 <= n; ++i) {
          int u = g - i, v = g + i - 1;
          ar[v] = u;
          ar[u] = v;
          mini = u;
        }
        n = mini - 1;
      }
    }
    for (int i = 1; i <= in; ++i) {
      printf("%d ", ar[i]);
    }
    putchar('\n');
  }
}
void constructQ(int n) {
  if (n <= 5 || (n & (n - 1)) == 0) {
    printf("NO\n");
    return;
  }
  int tmp[7] = {3, 6, 2, 5, 1, 7, 4};
  printf("YES\n");
  for (int i = 0; i < 7; ++i) {
    ar[i] = tmp[i];
  }
  if (n == 6) {
    swap(ar[5], ar[6]);
  }
  int st = 8;
  while (st <= n) {
    int ed = min(n, st * 2 - 1);
    for (int i = st - 1; i < ed; ++i) {
      ar[i] = i + 2;
    }
    ar[ed - 1] = st;
    st *= 2;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", ar[i]);
  }
  putchar('\n');
}
void solve() {
  int n;
  scanf("%d ", &n);
  constructP(n);
  constructQ(n);
}
int main() {
  solve();
  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;
int ar[1000000], mapping[1000000];
void constructP(int n) {
  if (n & 1) {
    printf("NO\n");
  } else {
    printf("YES\n");
    int in = n;
    while (n > 0) {
      if (n == 2) {
        ar[1] = 2;
        ar[2] = 1;
        break;
      } else {
        int g = 1;
        while (g * 2 <= n) {
          g *= 2;
        }
        int mini = 0;
        for (int i = 1; g + i - 1 <= n; ++i) {
          int u = g - i, v = g + i - 1;
          ar[v] = u;
          ar[u] = v;
          mini = u;
        }
        n = mini - 1;
      }
    }
    for (int i = 1; i <= in; ++i) {
      printf("%d ", ar[i]);
    }
    putchar('\n');
  }
}
void constructQ(int n) {
  if (n <= 5 || (n & (n - 1)) == 0) {
    printf("NO\n");
    return;
  }
  int tmp[7] = {3, 6, 2, 5, 1, 7, 4};
  printf("YES\n");
  for (int i = 0; i < 7; ++i) {
    ar[i] = tmp[i];
  }
  if (n == 6) {
    swap(ar[5], ar[6]);
  }
  int st = 8;
  while (st <= n) {
    int ed = min(n, st * 2 - 1);
    for (int i = st - 1; i < ed; ++i) {
      ar[i] = i + 2;
    }
    ar[ed - 1] = st;
    st *= 2;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d ", ar[i]);
  }
  putchar('\n');
}
void solve() {
  int n;
  scanf("%d ", &n);
  constructP(n);
  constructQ(n);
}
int main() {
  solve();
  return 0;
}

```