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 f[200005], g[200005];
void solve(int n) {
  if (n == 2) {
    f[1] = 2;
    f[2] = 1;
    return;
  }
  int i;
  if ((n >> 1) & 1) {
    solve((n >> 1) - 1);
    g[1] = n;
    for (i = 3; i <= n; i += 2) g[i] = f[i >> 1] << 1;
    for (i = 1; i <= n; i += 2) g[g[i]] = i;
    for (i = 1; i <= n; ++i) f[i] = g[i];
  } else {
    solve(n >> 1);
    for (i = 3; i <= n; i += 2) g[i] = f[i >> 1] << 1;
    g[1] = f[n >> 1] << 1;
    for (i = 1; i <= n; i += 2) g[g[i]] = i;
    for (i = 1; i <= n; ++i) f[i] = g[i];
  }
}
int n, i;
void sol(int n) {
  if (n & 1) {
    f[1] = 3;
    f[2] = 6;
    f[3] = 1;
    f[4] = 5;
    f[5] = 4;
    f[6] = 7;
    f[7] = 2;
    for (i = 8; i <= n; ++i) f[i] = i ^ 1;
    return;
  }
  if (n <= 11) {
    if (n == 6) {
      f[1] = 3;
      f[2] = 6;
      f[3] = 1;
      f[4] = 5;
      f[5] = 4;
      f[6] = 2;
    }
    if (n == 10) {
      f[1] = 3;
      f[2] = 6;
      f[3] = 1;
      f[4] = 5;
      f[5] = 4;
      f[6] = 2;
      f[7] = 9;
      f[8] = 10;
      f[9] = 7;
      f[10] = 8;
    }
    return;
  }
  sol(n >> 1);
  for (i = 1; i + 2 <= n; i += 2) g[i] = i + 2;
  g[i] = 1;
  for (i = 2; i <= n; i += 2) g[i] = f[i >> 1] << 1;
  for (i = 1; i <= n; ++i) f[i] = g[i];
}
int main() {
  cin >> n;
  if (n > 1 && !(n & 1)) {
    cout << "YES\n";
    solve(n);
    for (i = 1; i <= n; ++i) cout << f[i] << " ";
    cout << "\n";
  } else {
    cout << "NO\n";
  }
  if (n < 6 || ((n & -n) == n)) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    memset(f, 0, sizeof(f));
    memset(g, 0, sizeof(g));
    sol(n);
    for (i = 1; i <= n; ++i) cout << f[i] << " ";
    cout << '\n';
  }
}