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 int limite = 1000000;
int v[limite];
int sol[limite];
int visto[limite];
int n;
void escribe() {
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << sol[i];
  }
  cout << endl;
}
void sol1() {
  int c = 1;
  while (2 * c <= n) c *= 2;
  for (int i = n; i >= 1; i--) {
    if (not visto[i]) {
      int op = 2 * c - 1 - i;
      if (op == 0) {
        cout << "NO" << endl;
        return;
      }
      sol[i] = op;
      sol[op] = i;
      visto[i] = 1;
      visto[op] = 1;
    }
    if (c == i) c /= 2;
  }
  escribe();
}
void sol2() {
  if (n <= 5) {
    cout << "NO" << endl;
    return;
  }
  int c = 1;
  while (2 * c <= n) c *= 2;
  if (c == n) {
    cout << "NO" << endl;
    return;
  }
  int nv = 0;
  v[nv++] = 1;
  for (int p = 4; p <= c; p *= 2) {
    if (p == 4) {
      v[nv++] = 3;
      v[nv++] = 2;
    } else if (p == 8) {
      v[nv++] = 6;
      v[nv++] = 4;
      v[nv++] = 5;
      v[nv++] = 7;
    } else {
      int i = p / 2;
      v[nv++] = i + 1;
      v[nv++] = i;
      i += 2;
      for (; i < p; i++) v[nv++] = i;
    }
  }
  if (n == 6) {
    v[nv++] = 6;
    v[nv++] = 4;
    v[nv++] = 5;
    for (int i = 0; i < nv; i++) sol[v[i]] = v[(i + 1) % nv];
  } else if (n == 7) {
    v[nv++] = 6;
    v[nv++] = 4;
    v[nv++] = 5;
    v[nv++] = 7;
    for (int i = 0; i < nv; i++) sol[v[i]] = v[(i + 1) % nv];
  } else {
    for (int i = 0; i < nv; i++) sol[v[i]] = v[(i + 1) % nv];
    for (int i = c; i <= n; i++)
      if (i < n)
        sol[i] = i + 1;
      else
        sol[i] = c;
  }
  escribe();
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  sol1();
  sol2();
}