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;
template <typename T1, typename T2>
bool Max(T1& a, T2 b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T1, typename T2>
bool Min(T1& a, T2 b) {
  return a > b ? a = b, 1 : 0;
}
const int N = 100001;
int hsb_loc(int n) { return 31 - __builtin_clz(n); }
int hsb_loc(long long n) { return 63 - __builtin_clzll(n); }
void solve1(int n) {
  if (n & 1) {
    cout << "NO" << '\n';
    return;
  }
  cout << "YES" << '\n';
  vector<int> ans(n + 1);
  int on = n;
  while (n) {
    int hl = hsb_loc(n);
    int t = 1 << hl;
    int nxt = ((~n) & (t - 1)) - 1;
    for (int i = n; i >= (int)(t); --i) {
      int j = (~i) & (t - 1);
      ans[i] = j;
      ans[j] = i;
    }
    n = nxt;
  }
  for (int i = 1; i <= (int)(on); ++i) cout << ans[i] << ' ';
  cout << '\n';
}
void solve2(int n) {
  if (n < 6) {
    cout << "NO" << '\n';
    return;
  }
  if ((n & (n - 1)) == 0) {
    cout << "NO" << '\n';
    return;
  }
  cout << "YES" << '\n';
  if (n == 6) {
    cout << "3 6 2 5 1 4" << '\n';
    return;
  }
  vector<int> ans = {0, 3, 6, 2, 5, 7, 4, 1};
  ans.resize(n + 1);
  int beg = 8;
  while (beg < n) {
    int end = min(n, beg * 2 - 1);
    for (int i = beg; i <= (int)(end - 1); ++i) ans[i] = i + 1;
    ans[end] = beg;
    beg = end + 1;
  }
  for (int i = 1; i <= (int)(n); ++i) cout << ans[i] << ' ';
  cout << '\n';
}
void solve() {
  int n;
  cin >> n;
  solve1(n);
  solve2(n);
}
void init() {}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  init();
  int TC = 1;
  for (int TI = 1; TI <= (int)(TC); ++TI) {
    solve();
  }
  return 0;
}