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;
inline int in() {
  int x, y;
  y = scanf("%d", &x);
  return x;
}
const int N = 1e5 + 213;
int msbf(unsigned x) {
  union {
    double a;
    int b[2];
  };
  a = x;
  return (1 << ((b[1] >> 20) - 1023));
}
void findP(int n) {
  if (n % 2) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  int match[N] = {};
  for (int i = n; i >= 1; i--)
    if (match[i] == 0) {
      int t = msbf(i);
      int o = (t - 1) - (i - t);
      match[i] = o;
      match[o] = i;
    }
  for (int i = 0; i < (n); i++) cout << match[i + 1] << " \n"[i == n - 1];
}
void findQ(int n) {
  if (n <= 5 or msbf(n) == n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  int match[N] = {0, 5, 3, 2, 6, 7, 4, 1};
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  for (int i = 8; i <= n; i++) match[i] = (i % 2 ? i - 1 : i + 1);
  if (n % 2 == 0) {
    match[n] = n - 1;
    match[n - 2] = n;
  }
  for (int i = 0; i < (n); i++) cout << match[i + 1] << " \n"[i == n - 1];
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  findP(n);
  findQ(n);
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}