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 long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
const long long maxn = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 10;
long long dp[maxn];
long long ans[maxn];
int32_t main() {
  dp[1] = 1;
  for (long long i = 2; i < maxn; i++) dp[i] = dp[i / 2] * 2;
  long long n = in();
  if (n & 1) {
    cout << "NO\n";
  } else {
    long long nn = n;
    while (n) {
      long long maxPower = dp[n];
      for (long long x = 1; x <= n - maxPower + 1; x++)
        ans[maxPower - x] = maxPower + x - 1,
                       ans[maxPower + x - 1] = maxPower - x;
      n = 2 * maxPower - n - 2;
    }
    cout << "YES\n";
    for (long long i = 1; i <= nn; i++) cout << ans[i] << " ";
    cout << "\n";
    n = nn;
  }
  if (n <= 7) {
    bool ok = false;
    long long arr[7];
    for (long long i = 0; i < n; i++) arr[i] = i + 1;
    do {
      bool fl = true;
      for (long long i = 0; i < n; i++) {
        if ((arr[i] & (i + 1)) && arr[i] != i + 1) continue;
        fl = false;
      }
      if (fl) {
        ok = true;
        break;
      }
    } while (next_permutation(arr, arr + n));
    if (ok) {
      cout << "YES\n";
      for (long long i = 0; i < n; i++) cout << arr[i] << " ";
    } else
      cout << "NO\n";
  } else {
    if (__builtin_popcountll(n) == 1)
      cout << "NO\n";
    else {
      cout << "YES\n";
      long long arr[7];
      for (long long i = 0; i < 7; i++) arr[i] = i + 1;
      do {
        bool fl = true;
        for (long long i = 0; i < 7; i++) {
          if ((arr[i] & (i + 1)) && arr[i] != i + 1) continue;
          fl = false;
        }
        if (fl) break;
      } while (next_permutation(arr, arr + 7));
      for (long long i = 0; i < 7; i++) cout << arr[i] << " ";
      for (long long i = 8; i <= n; i *= 2) {
        long long lim = min(2 * i - 1, n);
        for (long long x = i; x <= lim; x++) {
          if (x == i)
            cout << lim << " ";
          else
            cout << x - 1 << " ";
        }
      }
    }
  }
}