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 warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 18;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
int ans[100050];
void aa1(int x) {
  if (x == 2) {
    ans[1] = 2;
    ans[2] = 1;
    return;
  }
  int i;
  for (i = 2; i <= 30; i++)
    if ((1 << i) > x + 2) break;
  int v = i - 1;
  if (x + 2 == (1 << v)) {
    for (int i = 1; i <= x; i++) ans[i] = x + 1 - i;
    return;
  }
  int nx;
  for (i = (1 << v); i <= x; i++) {
    int t = (1 << (v + 1)) - 1 - i;
    ans[i] = t;
    ans[t] = i;
    nx = t;
  }
  aa1(nx - 1);
}
void aa2(int N) {
  int v = 1;
  while (v * 2 <= N) v *= 2;
  int i;
  for (i = 2; i < v; i += 2) {
    ans[i] = i + 1;
    ans[i + 1] = i;
  }
  vector<int> Vu;
  for (i = v; i <= N; i++) Vu.push_back(i);
  if (Vu.back() % 2 == 0) swap(Vu[Vu.size() - 2], Vu.back());
  ans[Vu.back()] = 1;
  ans[1] = Vu.back();
  Vu.pop_back();
  for (i = 0; i < Vu.size(); i++) ans[Vu[i]] = Vu[(i + 1) % Vu.size()];
}
int main() {
  int N;
  scanf("%d", &N);
  if (N % 2 == 1)
    printf("NO\n");
  else {
    printf("YES\n");
    aa1(N);
    for (int i = 1; i <= N; i++) printf("%d ", ans[i]);
    printf("\n");
  }
  if (N <= 5)
    printf("NO\n");
  else {
    int t = 1;
    while (t * 2 <= N) t *= 2;
    if (t == N) return !printf("NO\n");
    if (t + 1 == N) {
      ans[N - 1] = N;
      ans[N] = N - 1;
      aa2(N - 2);
    } else
      aa2(N);
    printf("YES\n");
    for (int i = 1; i <= N; i++) printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}