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 n;
int digits(int x) {
  int ret = 0;
  while (x > 0) x >>= 1, ret++;
  return ret;
}
int A[100005], B[100005];
void solve(int start, int len) {
  if (len == 0) return;
  int p = (1 << (digits(len) - 1));
  swap(B[start + p - 2], B[start + p - 1]);
  solve(start, p - 2);
  solve(start + p, len - p);
  for (int i = 0; i < len - p; i++) swap(B[start + i], B[start + p + i]);
}
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(0);
  cin >> n;
  if (n % 2)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) B[i] = i;
    solve(1, n);
    for (int i = 1; i <= n; i++) cout << B[i] << " ";
    cout << endl;
  }
  int m = n;
  while (m % 2 == 0) m >>= 1;
  if ((m == 1) || (n < 6))
    cout << "NO" << endl;
  else if (n == 6)
    cout << "YES\n3 6 2 5 1 4" << endl;
  else if (n == 7)
    cout << "YES\n3 6 2 5 1 7 4" << endl;
  else {
    cout << "YES" << endl;
    int d = digits(n);
    for (int i = (1 << (d - 1)); i < n; i++) A[i] = i + 1;
    A[n] = (1 << (d - 1));
    d--;
    while (d > 3) {
      for (int i = (1 << (d - 1)); i < (1 << d); i++) {
        A[i] = i + 1;
      }
      A[(1 << d) - 1] = 1 << (d - 1);
      d--;
    }
    vector<int> V = {0, 3, 6, 2, 5, 1, 7, 4};
    for (int i = 1; i <= 7; i++) A[i] = V[i];
    for (int i = 1; i <= n; i++) cout << A[i] << " ";
    cout << endl;
  }
}