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;
const int maxN = (int)1e5 + 10;
int ans1[maxN];
int ans2[maxN];
vector<int> pws;
void solve1(int n) {
  if (n == 0) return;
  if (n % 2 == 1) {
    return;
  }
  int pw = 1;
  while (2 * pw <= n) {
    pw = pw * 2;
  }
  for (int i = 0; i <= n - pw; i++) {
    ans1[pw + i] = pw - i - 1;
    ans1[pw - i - 1] = pw + i;
  }
  solve1(2 * pw - n - 2);
}
void solve2(int n) {
  if (n == 7) {
    ans2[1] = 3;
    ans2[2] = 6;
    ans2[3] = 5;
    ans2[4] = 7;
    ans2[5] = 1;
    ans2[6] = 2;
    ans2[7] = 4;
    return;
  }
  if (n == 6) {
    ans2[1] = 3;
    ans2[2] = 6;
    ans2[3] = 2;
    ans2[4] = 5;
    ans2[5] = 1;
    ans2[6] = 4;
    return;
  }
  if (n <= 5) return;
  int pw = 1;
  while (2 * pw <= n) {
    pw = pw * 2;
    pws.push_back(pw);
  }
  if (n == pw) return;
  for (int i = n; i >= pws[pws.size() - 1] + 1; i--) {
    ans2[i] = i - 1;
  }
  ans2[pws[pws.size() - 1]] = n;
  solve2(pws[pws.size() - 1] - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  solve1(n);
  if (ans1[1] != 0) {
    cout << "YES" << '\n';
    for (int i = 1; i <= n; i++) {
      cout << ans1[i] << " ";
    }
    cout << '\n';
  } else
    cout << "NO" << '\n';
  solve2(n);
  if (ans2[1] != 0) {
    cout << "YES" << '\n';
    for (int i = 1; i <= n; i++) {
      cout << ans2[i] << " ";
    }
  } else
    cout << "NO";
}