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;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
vector<int> calc1(int n) {
  vector<int> res;
  if (n == 2) return {2, 1};
  if (n % 2 == 1) return {};
  int t = floor(log2(n + 2)), i;
  for (i = 1; i <= (1 << t) - 2; i++) res.push_back((1 << t) - 1 - i);
  if (res.size() == n) return res;
  res.push_back((1 << t));
  res.push_back((1 << t) - 1);
  if (res.size() == n) return res;
  for (i = 1; i <= n - (1 << t); i++) res.push_back((1 << t) - 1 - i);
  vector<int> res2 = calc1(n - (1 << t));
  for (i = 0; i < res2.size(); i++) res[i] = res2[i] + (1 << t);
  return res;
}
vector<int> calc2(int n) {
  if (log2(n) == floor(log2(n))) return {};
  if (n <= 5) return {};
  if (n == 6) return {3, 6, 1, 5, 4, 2};
  if (n == 7) return {3, 6, 1, 5, 4, 7, 2};
  int t = floor(log2(n + 1));
  if (floor(log2(n + 1)) == log2(n + 1)) t--;
  vector<int> res = calc2((1 << t) - 1);
  int left = n - ((1 << t) - 1);
  int i;
  for (i = 0; i < left; i++) res.push_back((1 << t) + (i + 1) % left);
  return res;
}
int n, m, i, j, k, used[10];
vector<int> res;
int main() {
  cin >> n;
  vector<int> res1 = calc1(n);
  if (res1.size()) {
    cout << "YES\n";
    for (int g : res1) cout << g << ' ';
    cout << "\n";
  } else
    cout << "NO\n";
  vector<int> res2 = calc2(n);
  if (res2.size()) {
    cout << "YES\n";
    for (int g : res2) cout << g << ' ';
    cout << "\n";
  } else
    cout << "NO\n";
}