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 long double eps = 1e-9;
const double EPS = 1e-9;
int ar[] = {1, -1, 0, 0, 1, 1, -1, -1};
int ac[] = {0, 0, 1, -1, 1, -1, 1, -1};
int p[200005];
int q[200005];
void solve1(int n) {
  int k = 1;
  if (n & 1) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  while (k <= n) k *= 2;
  k /= 2;
  int last = n + 1;
  while (k != 0) {
    for (int i = k; i < last; i++) {
      p[i] = k - (i - k + 1);
      p[k - (i - k + 1)] = i;
    }
    last = min(last, k - (last - k));
    k /= 2;
  }
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  cout << "\n";
}
void solve2(int n) {
  if (n < 6) {
    cout << "NO\n";
    return;
  }
  int k = 1;
  while (2 * k <= n) k *= 2;
  if (n == k) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  for (int i = k; i < n; i++) q[i] = i + 1;
  q[n] = k;
  while (k != 4) {
    for (int i = k / 2; i < k - 1; i++) {
      q[i] = i + 1;
    }
    q[k - 1] = k / 2;
    k /= 2;
  }
  q[1] = 5;
  q[2] = 3;
  q[3] = 2;
  q[4] = 6;
  q[5] = 7;
  q[6] = 4;
  q[7] = 1;
  for (int i = 1; i <= n; i++) cout << q[i] << " ";
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  solve1(n);
  solve2(n);
  return 0;
}