#include <bits/stdc++.h>
using namespace std;
int const maxn = 1e5 + 5;
int ans[maxn], used[maxn];
inline int oks(vector<int> a) {
  for (int i = 0; i < (int)a.size(); ++i)
    if (a[i] == i + 1 || (a[i] & (i + 1)) == 0) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, cnt = 1, N;
  cin >> n;
  N = n;
  if (n % 2 == 1) {
    cout << "NO" << '\n';
  } else {
    cout << "YES" << '\n';
    while (n > 0) {
      int x = 1;
      while (x * 2 <= n) x *= 2;
      for (int w = x; w <= n; ++w) {
        ans[w] = x - (w - x) - 1;
        ans[x - (w - x) - 1] = w;
      }
      n -= 2 * (n - x + 1);
    }
    for (int i = 1; i <= N; ++i) cout << ans[i] << " ";
    cout << '\n';
  }
  n = N;
  if (n <= 5) {
    cout << "NO" << '\n';
    exit(0);
  }
  while (n > 0) {
    int x = 1;
    while (x * 2 <= n) x *= 2;
    if (x == n) {
      cout << "NO" << '\n';
      exit(0);
    }
    if (n == 6) {
      ans[1] = 3, ans[2] = 6, ans[3] = 2, ans[4] = 5, ans[5] = 1, ans[6] = 4;
      n = 0;
      break;
    }
    if ((n - x + 1) % 2 == 1) {
      int R = n, cur = (n - x) / 2 + 1;
      for (int i = x; cur > 0; ++i, cur--) {
        if (i == x + 1) continue;
        ans[i] = R;
        ans[R] = i;
        R--;
      }
      ans[x + 1] = x - 1;
      ans[x - 1] = x + 1;
      n = x - 2;
    } else {
      while (n > 7) {
        ans[n] = n - 1;
        ans[n - 1] = n;
        n -= 2;
      }
      ans[1] = 3, ans[2] = 6, ans[3] = 1, ans[4] = 5, ans[5] = 4, ans[6] = 7,
      ans[7] = 2;
      n = 0;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= N; ++i) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}

### Prompt

Your challenge is to write a Cpp solution to the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int const maxn = 1e5 + 5;
int ans[maxn], used[maxn];
inline int oks(vector<int> a) {
  for (int i = 0; i < (int)a.size(); ++i)
    if (a[i] == i + 1 || (a[i] & (i + 1)) == 0) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, cnt = 1, N;
  cin >> n;
  N = n;
  if (n % 2 == 1) {
    cout << "NO" << '\n';
  } else {
    cout << "YES" << '\n';
    while (n > 0) {
      int x = 1;
      while (x * 2 <= n) x *= 2;
      for (int w = x; w <= n; ++w) {
        ans[w] = x - (w - x) - 1;
        ans[x - (w - x) - 1] = w;
      }
      n -= 2 * (n - x + 1);
    }
    for (int i = 1; i <= N; ++i) cout << ans[i] << " ";
    cout << '\n';
  }
  n = N;
  if (n <= 5) {
    cout << "NO" << '\n';
    exit(0);
  }
  while (n > 0) {
    int x = 1;
    while (x * 2 <= n) x *= 2;
    if (x == n) {
      cout << "NO" << '\n';
      exit(0);
    }
    if (n == 6) {
      ans[1] = 3, ans[2] = 6, ans[3] = 2, ans[4] = 5, ans[5] = 1, ans[6] = 4;
      n = 0;
      break;
    }
    if ((n - x + 1) % 2 == 1) {
      int R = n, cur = (n - x) / 2 + 1;
      for (int i = x; cur > 0; ++i, cur--) {
        if (i == x + 1) continue;
        ans[i] = R;
        ans[R] = i;
        R--;
      }
      ans[x + 1] = x - 1;
      ans[x - 1] = x + 1;
      n = x - 2;
    } else {
      while (n > 7) {
        ans[n] = n - 1;
        ans[n - 1] = n;
        n -= 2;
      }
      ans[1] = 3, ans[2] = 6, ans[3] = 1, ans[4] = 5, ans[5] = 4, ans[6] = 7,
      ans[7] = 2;
      n = 0;
    }
  }
  cout << "YES" << '\n';
  for (int i = 1; i <= N; ++i) cout << ans[i] << " ";
  cout << '\n';
  return 0;
}

```