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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
inline int read() {
  int data = 0, w = 1;
  char ch = getchar();
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') data = data * 10 + (ch ^ 48), ch = getchar();
  return data * w;
}
const int N(1e5 + 10);
int n, p[N];
void dfs(int m) {
  if (m == 0) return;
  int k = 1;
  while ((k << 1) <= m) k <<= 1;
  std::reverse(p + (k << 1) - m - 1, p + m + 1);
  dfs((k << 1) - m - 2);
}
int main() {
  n = read();
  if (n & 1)
    puts("NO");
  else {
    for (int i = 1; i <= n; i++) p[i] = i;
    puts("YES"), dfs(n);
    for (int i = 1; i <= n; i++) printf("%d%c", p[i], " \n"[i == n]);
  }
  if (n == (n & -n) || n == 3 || n == 5)
    puts("NO");
  else {
    puts("YES");
    for (int i = 1; i <= n; i++) p[i] = i;
    for (int i = 2; i < n; i += 2) std::swap(p[i], p[i + 1]);
    if (n & 1) {
      printf("7 3 2 5 6 4 1%c", " \n"[n == 7]);
      for (int i = 8; i <= n; i++) printf("%d%c", p[i], " \n"[i == n]);
    } else {
      p[1] = n - 1, p[n - 2] = n, p[n - 1] = 1, p[n] = n - 2;
      for (int i = 1; i <= n; i++) printf("%d%c", p[i], " \n"[i == n]);
    }
  }
  return 0;
}