#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
long long int N, M, K, H, W, L, R;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  int two[20] = {};
  two[0] = 1;
  for (int i = 1; i < 20; i++) {
    two[i] = two[i - 1] * 2;
  }
  if (N % 2) {
    cout << "NO\n";
  } else {
    for (int i = 0; i < 20; i++) {
      if (N >= two[i]) {
        M = two[i] * 2;
      }
    }
    vector<int> v(N + 1);
    for (int i = 1; i <= N; i++) {
      v[i] = i ^ (M - 1);
    }
    vector<vector<int>> husoku(20);
    for (int i = 1; i < M - 1 - N; i++) {
      husoku[0].push_back(i);
    }
    int xornum = 0;
    for (int i = 0; i < 20; i++) {
      if (husoku[0].size() >= two[i]) {
        xornum = two[i] * 2;
      }
    }
    xornum -= 2;
    for (int loop = 1;; loop++) {
      if (husoku[loop - 1].empty()) {
        break;
      }
      for (auto i : husoku[loop - 1]) {
        if (v[xornum] <= N) {
          husoku[loop].push_back(v[xornum]);
        }
        v[xornum] = i;
        xornum--;
      }
      for (int i = 0; i < 20; i++) {
        if (husoku[loop].size() >= two[i]) {
          xornum = two[i] * 2;
        }
      }
      xornum -= 2;
    }
    cout << "YES\n";
    for (int i = 1; i <= N; i++) {
      if (i > 1) {
        cout << " ";
      }
      int a = i & v[i];
      cout << v[i];
    }
    cout << endl;
  }
  if (N <= 5) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < 20; i++) {
    if (N == two[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  vector<int> v(N + 1);
  for (int i = 1; i <= N; i++) {
    v[i] = i;
  }
  v[1] = 5;
  v[2] = 3;
  v[3] = 2;
  v[4] = 6;
  v[5] = 1;
  v[6] = 4;
  if (N % 2) {
    for (int i = 6; i < N; i += 2) {
      swap(v[i], v[i + 1]);
    }
  } else if (N > 6) {
    for (int i = 6; i < N; i += 2) {
      swap(v[i], v[i + 1]);
    }
    for (int i = 0; i < 20; i++) {
      if (N > two[i]) {
        M = two[i];
      }
    }
    swap(v[N], v[N - M]);
  }
  for (int i = 1; i <= N; i++) {
    if (i > 1) {
      cout << " ";
    }
    int a = v[i] & i;
    cout << v[i];
  }
  cout << endl;
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

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;
const long long int MOD = 1000000007;
long long int N, M, K, H, W, L, R;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  int two[20] = {};
  two[0] = 1;
  for (int i = 1; i < 20; i++) {
    two[i] = two[i - 1] * 2;
  }
  if (N % 2) {
    cout << "NO\n";
  } else {
    for (int i = 0; i < 20; i++) {
      if (N >= two[i]) {
        M = two[i] * 2;
      }
    }
    vector<int> v(N + 1);
    for (int i = 1; i <= N; i++) {
      v[i] = i ^ (M - 1);
    }
    vector<vector<int>> husoku(20);
    for (int i = 1; i < M - 1 - N; i++) {
      husoku[0].push_back(i);
    }
    int xornum = 0;
    for (int i = 0; i < 20; i++) {
      if (husoku[0].size() >= two[i]) {
        xornum = two[i] * 2;
      }
    }
    xornum -= 2;
    for (int loop = 1;; loop++) {
      if (husoku[loop - 1].empty()) {
        break;
      }
      for (auto i : husoku[loop - 1]) {
        if (v[xornum] <= N) {
          husoku[loop].push_back(v[xornum]);
        }
        v[xornum] = i;
        xornum--;
      }
      for (int i = 0; i < 20; i++) {
        if (husoku[loop].size() >= two[i]) {
          xornum = two[i] * 2;
        }
      }
      xornum -= 2;
    }
    cout << "YES\n";
    for (int i = 1; i <= N; i++) {
      if (i > 1) {
        cout << " ";
      }
      int a = i & v[i];
      cout << v[i];
    }
    cout << endl;
  }
  if (N <= 5) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < 20; i++) {
    if (N == two[i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  vector<int> v(N + 1);
  for (int i = 1; i <= N; i++) {
    v[i] = i;
  }
  v[1] = 5;
  v[2] = 3;
  v[3] = 2;
  v[4] = 6;
  v[5] = 1;
  v[6] = 4;
  if (N % 2) {
    for (int i = 6; i < N; i += 2) {
      swap(v[i], v[i + 1]);
    }
  } else if (N > 6) {
    for (int i = 6; i < N; i += 2) {
      swap(v[i], v[i + 1]);
    }
    for (int i = 0; i < 20; i++) {
      if (N > two[i]) {
        M = two[i];
      }
    }
    swap(v[N], v[N - M]);
  }
  for (int i = 1; i <= N; i++) {
    if (i > 1) {
      cout << " ";
    }
    int a = v[i] & i;
    cout << v[i];
  }
  cout << endl;
  return 0;
}

```