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>
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1);
const long long INFF = 1e17;
const int INF = 1e9 + 1;
const int mod = 1e9 + 7;
const int MAX = 1e5 + 7;
int n;
int ans[MAX];
void sol() {
  if (n % 2) {
    puts("NO");
    return;
  } else
    puts("YES");
  int p = 0;
  for (int i = 17; i >= 0; --i)
    if (n & (1 << i)) {
      p = i;
      break;
    }
  int v = (1 << (p + 1)) - 1;
  for (int i = n; i >= 1; --i) {
    if (ans[i]) continue;
    while (!(i & (1 << p))) v >>= 1, p--;
    ans[i] = v - i;
    ans[v - i] = i;
  }
  for (int i = (1); i < (n + 1); ++i) printf("%d%c", ans[i], " \n"[i == n]);
  return;
}
void sol2() {
  memset(ans, 0, sizeof(ans));
  ;
  if (n % 2) {
    if (n <= 5) {
      puts("NO");
      return;
    } else
      puts("YES");
    ans[5] = 1;
    ans[7] = 5;
    ans[1] = 7;
    ans[2] = 3;
    ans[3] = 2;
    ans[4] = 6;
    ans[6] = 4;
    for (int i = 8; i <= n; i += 2) {
      ans[i] = i + 1;
      ans[i + 1] = i;
    }
  } else {
    int p = 0;
    for (int i = 17; i >= 0; --i)
      if (n & (1 << i)) {
        p = i;
        break;
      }
    if ((n ^ (1 << p)) == 0) {
      puts("NO");
      return;
    } else
      puts("YES");
    ans[n - 1] = 1;
    ans[1] = n - 1;
    ans[n] = n - 2;
    ans[n - 2] = n;
    for (int i = 2; i <= n - 3; i += 2) {
      ans[i] = i + 1;
      ans[i + 1] = i;
    }
  }
  for (int i = (1); i < (n + 1); ++i) printf("%d%c", ans[i], " \n"[i == n]);
  return;
}
int main(void) {
  scanf("%d", &n);
  sol();
  sol2();
  return 0;
}