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;
int daj(int n) {
  int res = 1;
  while (res <= n) res *= 2;
  res /= 2;
  return res;
}
int ans[100111];
void solve1(int n) {
  if (n & 1) {
    printf("NO\n");
    return;
  }
  int N = n;
  while (n > 0) {
    int pot = daj(n);
    for (int i = 0; i <= n - pot; ++i) {
      ans[pot - 1 - i] = pot + i;
      ans[pot + i] = pot - 1 - i;
    }
    n = 2 * pot - n - 2;
  }
  printf("YES\n");
  for (int i = 1; i <= N; ++i) {
    assert((ans[i] & i) == 0);
    printf("%d ", ans[i]);
  }
  printf("\n");
}
void solve2(int n) {
  if (daj(n) == n) {
    printf("NO\n");
    return;
  }
  vector<int> v;
  for (int i = 1; i <= min(n, 7); ++i) v.push_back(i);
  bool ok = 0;
  do {
    ok = 1;
    for (int i = 0; i < min(n, 7); ++i) {
      if ((v[i] & (i + 1)) == 0 || i + 1 == v[i]) ok = 0;
    }
    if (ok) break;
  } while (next_permutation(v.begin(), v.end()));
  if (ok && n <= 7) {
    printf("YES\n");
    for (auto it : v) printf("%d ", it);
    return;
  }
  if (n <= 7) {
    printf("NO\n");
    return;
  }
  for (int i = 1; i <= 7; ++i) {
    ans[i] = v[i - 1];
  }
  int K = 8;
  while (K <= n) {
    if (daj(K + 1) == K + 1) {
      ans[K] = daj(K + 1) / 2;
      K++;
      continue;
    }
    if (K == n) {
      ans[K] = daj(K);
      K++;
      continue;
    }
    ans[K] = K + 1;
    K += 1;
  }
  printf("YES\n");
  for (int i = 1; i <= n; ++i) {
    assert((ans[i] & i) > 0);
    printf("%d ", ans[i]);
  }
  printf("\n");
}
int main() {
  int n;
  scanf("%d", &n);
  solve1(n);
  solve2(n);
  return 0;
}