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 MAXN = 100100;
int N;
int ans1[MAXN];
int ans2[MAXN];
int go(int x) {
  int power = 1;
  while (power * 2 <= x) power *= 2;
  for (int i = 0; power + i <= x; i++) {
    ans1[power + i] = power - 1 - i;
    ans1[power - 1 - i] = power + i;
  }
  return 2 * power - 1 - x - 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N;
  if (N % 2 == 1)
    cout << "NO\n";
  else {
    int temp = N;
    while (temp > 1) temp = go(temp);
    cout << "YES\n";
    for (int i = 1; i <= N; i++) cout << ans1[i] << " ";
    cout << "\n";
  }
  ans2[1] = 7;
  ans2[2] = 3;
  ans2[3] = 6;
  ans2[4] = 5;
  ans2[5] = 1;
  ans2[6] = 2;
  ans2[7] = 4;
  if (N <= 5 || ((N & (N - 1)) == 0))
    cout << "NO\n";
  else if (N == 6) {
    cout << "YES\n";
    cout << "3 6 2 5 1 4\n";
  } else {
    cout << "YES\n";
    for (int i = 8; i < N; i *= 2)
      for (int j = i; j < 2 * i && j <= N; j++) {
        if (j == 2 * i - 1 || j == N)
          ans2[j] = i;
        else
          ans2[j] = j + 1;
      }
    for (int i = 1; i <= N; i++) cout << ans2[i] << " ";
    cout << "\n";
  }
  return 0;
}