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 n, i, ans[100002];
bool vis[100002], flag;
void solve(int n) {
  if (n <= 0) return;
  int k = 1;
  while (k <= n) k <<= 1;
  for (int i = k - n - 1; i <= n; i++) ans[i] = (i ^ (k - 1));
  solve(k - n - 2);
}
bool check(int n) {
  while (n % 2 == 0) n /= 2;
  return (n != 1);
}
void dfs(int x) {
  if (flag) return;
  if (x == n + 1) {
    bool f = 1;
    for (int i = 1; i <= n; i++) {
      if (ans[i] == i) f = 0;
    }
    for (int i = 1; i <= n; i++) {
      if ((ans[i] & i) == 0) {
        f = 0;
        break;
      }
    }
    if (f) flag = 1;
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      vis[i] = 1;
      ans[x] = i;
      dfs(x + 1);
      vis[i] = 0;
    }
    if (flag) return;
  }
}
int main() {
  scanf("%d", &n);
  if (n % 2 == 1)
    puts("NO");
  else {
    solve(n);
    puts("YES");
    for (i = 1; i <= n; i++) printf("%d ", ans[i]);
    puts("");
  }
  for (i = 1; i <= n; i++) ans[i] = i;
  if (n < 7) {
    dfs(1);
    if (!flag)
      puts("NO");
    else {
      puts("YES");
      for (i = 1; i <= n; i++) printf("%d ", ans[i]);
      puts("");
    }
  } else if (n % 2 == 0) {
    if (!check(n))
      puts("NO");
    else {
      puts("YES");
      for (i = 2; i <= n - 4; i += 2) swap(ans[i], ans[i + 1]);
      swap(ans[1], ans[n - 1]);
      swap(ans[n - 2], ans[n]);
      for (i = 1; i <= n; i++) printf("%d ", ans[i]);
      puts("");
    }
  } else {
    puts("YES");
    ans[1] = 3;
    ans[2] = 6;
    ans[3] = 1;
    ans[4] = 5;
    ans[5] = 7;
    ans[6] = 2;
    ans[7] = 4;
    for (i = 8; i <= n; i += 2) swap(ans[i], ans[i + 1]);
    for (i = 1; i <= n; i++) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}