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 main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  if (N % 2 == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    int ans[N + 1];
    int cur = N;
    while (cur > 0) {
      int po = 1;
      while (po <= cur) po *= 2;
      po /= 2;
      int mi = cur;
      for (int i = 1; i <= cur; i++) {
        if (po + i - 1 > cur) break;
        ans[po - i] = po + i - 1;
        ans[po + i - 1] = po - i;
        mi = min(mi, po - i);
      }
      cur = mi - 1;
    }
    for (int i = 1; i <= N; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  if (N <= 5) {
    cout << "NO" << endl;
  } else {
    if (N == 6) {
      cout << "YES" << endl;
      cout << "3 6 2 5 1 4" << endl;
    } else {
      int po = 1;
      while (po <= N) po *= 2;
      po /= 2;
      if (po == N) {
        cout << "NO" << endl;
      } else {
        cout << "YES" << endl;
        int ans[N + 1];
        ans[1] = 7;
        ans[2] = 3;
        ans[3] = 6;
        ans[4] = 5;
        ans[5] = 1;
        ans[6] = 2;
        ans[7] = 4;
        int prevpow = 8;
        for (int i = 8; i <= N; i++) {
          if (i == prevpow * 2 - 1 || i == N) {
            ans[i] = prevpow;
            prevpow *= 2;
          } else {
            ans[i] = i + 1;
          }
        }
        for (int i = 1; i <= N; i++) {
          cout << ans[i] << " ";
        }
        cout << endl;
      }
    }
  }
  cin >> N;
}