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 N = 100005;
int a[N];
void solve1(int n) {
  if (n == 0) return;
  int m = 1;
  while (2 * m + 1 <= n) m = 2 * m + 1;
  solve1(2 * m - n);
  for (int i = m + 1; i <= n; i++) {
    int j = 2 * m - i + 1;
    a[i] = j;
    a[j] = i;
  }
}
bool isPowerOf2(int n) { return (n & (n - 1)) == 0; }
void solve2(int n) {
  a[1] = 5;
  a[5] = 1;
  vector<int> v;
  for (int i = 2; i <= n + 1; i++) {
    if (i == 5) continue;
    if ((i != 2 && isPowerOf2(i)) || i == n + 1) {
      for (int j = 0; j + 1 < v.size(); j++) {
        a[v[j]] = v[j + 1];
      }
      a[v.back()] = v[0];
      v.clear();
    }
    v.push_back(i);
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(32);
  int n;
  cin >> n;
  if (n % 2 == 1) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    solve1(n);
    for (int i = 1; i <= n; i++) {
      cout << a[i] << " ";
    }
    cout << '\n';
  }
  if (n <= 5 || isPowerOf2(n)) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    solve2(n);
    for (int i = 1; i <= n; i++) {
      cout << a[i] << " ";
    }
  }
  return 0;
}