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 inf = 1 << 30;
const long long Inf = 1ll << 60ll;
namespace io {
char buf[(1 << 23)], *p1 = buf, *p2 = buf, c;
int f;
template <typename T>
T read() {
  T x = 0;
  f = 0;
  c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (!isdigit(c))
    (c == '-') && (f = 1),
        c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin),
                          p1 == p2)
                 ? EOF
                 : *p1++);
  while (isdigit(c))
    x = x * 10 + (c & 15),
    c = (p1 == p2 &&
                 (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin), p1 == p2)
             ? EOF
             : *p1++);
  return f ? -x : x;
}
}  // namespace io
const int N = 100005;
int ans[N], n, tmp[N];
void solve(int m) {
  if (!m) return;
  int t = 1;
  while (t * 2 <= m) t *= 2;
  int le = t + t - m - 1;
  for (int i = le; i <= m; ++i) ans[i] = t + t - i - 1;
  solve(le - 1);
}
int main() {
  n = io::read<int>();
  if (n & 1) {
    puts("NO");
  } else {
    puts("YES");
    solve(n);
    for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
  }
  memset(ans, 0, sizeof(ans));
  int t = 1;
  while (t * 2 <= n) t *= 2;
  if (t == n) {
    puts("NO");
    return 0;
  } else {
    if (n <= 5) {
      puts("NO");
      return 0;
    }
    if (n == 6) {
      printf("YES\n3 6 2 5 1 4\n");
      return 0;
    }
    puts("YES");
    ans[1] = 7;
    ans[2] = 3;
    ans[3] = 2;
    ans[4] = 5;
    ans[5] = 6;
    ans[6] = 4;
    ans[7] = 1;
    int le = 8, tot, ri;
    while (le <= n) {
      tot = 0;
      ri = min(le * 2 - 1, n);
      for (int i = le; i <= ri; ++i) tmp[++tot] = i;
      for (int i = le; i < ri; ++i) ans[i] = tmp[i - le + 2];
      ans[ri] = tmp[1];
      le <<= 1;
    }
    for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}