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>
#pragma comment(linker, "/STACK:536870912")
#pragma warning(disable : 4996)
using namespace std;
const int N = 1e5 + 100;
int a[N];
void f(int n) {
  if (n == 0) return;
  int c = 0, t = n;
  while (t > 0) {
    t >>= 1;
    c++;
  }
  int g = 1 << (c - 1);
  for (int i = 0; g + i <= n; i++) {
    a[g + i] = g - i - 1;
    a[g - i - 1] = g + i;
  }
  f((1 << c) - n - 2);
}
bool brute(int n) {
  for (int i = 1; i <= n; i++) a[i] = i;
  bool ok = false;
  do {
    ok = true;
    for (int i = 1; i <= n; i++) {
      if (a[i] == i || (a[i] & i) == 0) {
        ok = false;
        break;
      }
    }
  } while (!ok && next_permutation(a + 1, a + n + 1));
  return ok;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n & 1)
    printf("NO\n");
  else {
    printf("YES\n");
    f(n);
    for (int i = 1; i <= n; i++) printf("%d ", a[i]);
    printf("\n");
  }
  int c = 0, t = n;
  while (t > 0) c += t & 1, t >>= 1;
  if (c == 1) {
    printf("NO");
    return 0;
  }
  if (n <= 7) {
    int r = brute(n);
    printf("%s\n", r ? "YES" : "NO");
    if (r)
      for (int i = 1; i <= n; i++) {
        printf("%d ", a[i]);
      }
    return 0;
  }
  brute(7);
  for (int p = 16; (p >> 1) < n; p <<= 1) {
    for (int j = p >> 1; j < min(n, p - 1); j++) a[j] = j + 1;
    a[min(n, p - 1)] = p >> 1;
  }
  printf("YES\n");
  for (int j = 1; j <= n; j++) {
    printf("%d ", a[j]);
  }
  return 0;
}