#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 123;
const long long LINF = (long long)1e18 + 123;
const long double EPS = (long double)1e-7;
const long long MOD = (long long)1e9 + 7;
long long power(long long x, long long y, long long mod = MOD) {
  if (y == 0) {
    return 1;
  }
  if (y & 1) {
    return power(x, y - 1, mod) * x % mod;
  } else {
    long long tmp = power(x, y / 2, mod);
    return tmp * tmp % mod;
  }
}
template <typename A, typename B>
bool mini(A &x, const B &y) {
  if (y < x) {
    x = y;
    return true;
  }
  return false;
}
template <typename A, typename B>
bool maxi(A &x, const B &y) {
  if (y > x) {
    x = y;
    return true;
  }
  return false;
}
void add(long long &x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
  if (x < 0) x += MOD;
}
long long mult(long long x, long long y) { return x * y % MOD; }
void run();
int main() {
  if (strlen("")) {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  run();
  return 0;
}
int n;
void print(vector<int> &a) {
  for (int x : a) {
    cout << x << " ";
  }
  cout << "\n";
}
bool checkp(vector<int> &a) {
  n = (int)(a).size();
  for (int i = 0; i < n; i++) {
    if ((a[i] & (i + 1)) != 0 || a[i] == i + 1) {
      return 0;
    }
  }
  return 1;
}
bool checkq(vector<int> &a) {
  n = (int)(a).size();
  for (int i = 0; i < n; i++) {
    if ((a[i] & (i + 1)) == 0 || a[i] == i + 1) {
      return 0;
    }
  }
  return 1;
}
void solvep(vector<int> &a, vector<int> pos, vector<int> els, int bit) {
  assert((int)(els).size() == (int)(pos).size());
  if (!(int)(els).size()) {
    return;
  }
  if ((int)(els).size() == 1) {
    a[pos[0] - 1] = els[0];
    return;
  }
  vector<int> zero_pos, zero_els;
  vector<int> one_pos, one_els;
  for (int x : pos) {
    if (x & (1 << bit)) {
      one_pos.push_back(x);
    } else {
      zero_pos.push_back(x);
    }
  }
  for (int x : els) {
    if (x & (1 << bit)) {
      one_els.push_back(x);
    } else {
      zero_els.push_back(x);
    }
  }
  while ((int)(one_pos).size() < (int)(zero_els).size()) {
    one_pos.push_back(zero_pos.back());
    zero_pos.pop_back();
  }
  solvep(a, zero_pos, one_els, bit + 1);
  solvep(a, one_pos, zero_els, bit + 1);
};
vector<int> getp(int n) {
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = i + 1;
  }
  solvep(a, a, a, 0);
  return a;
}
vector<int> getq(int n) {
  if (n <= 7) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      a[i] = i + 1;
    }
    do {
      if (checkq(a)) {
        return a;
      }
    } while (next_permutation((a).begin(), (a).end()));
    assert(0);
    return {};
  } else {
    vector<int> a(7);
    for (int i = 0; i < 7; i++) {
      a[i] = i + 1;
    }
    do {
      if (checkq(a)) {
        break;
      }
    } while (next_permutation((a).begin(), (a).end()));
    a.resize(n);
    for (int i = 7; i < n; i++) {
      a[i] = i + 1;
    }
    int cur = 8;
    int ptr = 7;
    while (ptr < n) {
      int l = ptr;
      int r = min(n, l + cur);
      rotate(a.begin() + l, a.begin() + l + 1, a.begin() + r);
      cur *= 2;
      ptr = r;
    }
    return a;
  }
}
void run() {
  cin >> n;
  if (n % 2 == 0) {
    auto res = getp(n);
    assert(checkp(res));
    cout << "YES\n";
    print(res);
  } else {
    cout << "NO\n";
  }
  int k = 1;
  while (2 * k <= n) {
    k *= 2;
  }
  if (n == k || n < 6) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  auto res = getq(n);
  assert(checkq(res));
  print(res);
}

### Prompt

Please provide a Cpp coded solution 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 int INF = (int)2e9 + 123;
const long long LINF = (long long)1e18 + 123;
const long double EPS = (long double)1e-7;
const long long MOD = (long long)1e9 + 7;
long long power(long long x, long long y, long long mod = MOD) {
  if (y == 0) {
    return 1;
  }
  if (y & 1) {
    return power(x, y - 1, mod) * x % mod;
  } else {
    long long tmp = power(x, y / 2, mod);
    return tmp * tmp % mod;
  }
}
template <typename A, typename B>
bool mini(A &x, const B &y) {
  if (y < x) {
    x = y;
    return true;
  }
  return false;
}
template <typename A, typename B>
bool maxi(A &x, const B &y) {
  if (y > x) {
    x = y;
    return true;
  }
  return false;
}
void add(long long &x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
  if (x < 0) x += MOD;
}
long long mult(long long x, long long y) { return x * y % MOD; }
void run();
int main() {
  if (strlen("")) {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(12);
  run();
  return 0;
}
int n;
void print(vector<int> &a) {
  for (int x : a) {
    cout << x << " ";
  }
  cout << "\n";
}
bool checkp(vector<int> &a) {
  n = (int)(a).size();
  for (int i = 0; i < n; i++) {
    if ((a[i] & (i + 1)) != 0 || a[i] == i + 1) {
      return 0;
    }
  }
  return 1;
}
bool checkq(vector<int> &a) {
  n = (int)(a).size();
  for (int i = 0; i < n; i++) {
    if ((a[i] & (i + 1)) == 0 || a[i] == i + 1) {
      return 0;
    }
  }
  return 1;
}
void solvep(vector<int> &a, vector<int> pos, vector<int> els, int bit) {
  assert((int)(els).size() == (int)(pos).size());
  if (!(int)(els).size()) {
    return;
  }
  if ((int)(els).size() == 1) {
    a[pos[0] - 1] = els[0];
    return;
  }
  vector<int> zero_pos, zero_els;
  vector<int> one_pos, one_els;
  for (int x : pos) {
    if (x & (1 << bit)) {
      one_pos.push_back(x);
    } else {
      zero_pos.push_back(x);
    }
  }
  for (int x : els) {
    if (x & (1 << bit)) {
      one_els.push_back(x);
    } else {
      zero_els.push_back(x);
    }
  }
  while ((int)(one_pos).size() < (int)(zero_els).size()) {
    one_pos.push_back(zero_pos.back());
    zero_pos.pop_back();
  }
  solvep(a, zero_pos, one_els, bit + 1);
  solvep(a, one_pos, zero_els, bit + 1);
};
vector<int> getp(int n) {
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = i + 1;
  }
  solvep(a, a, a, 0);
  return a;
}
vector<int> getq(int n) {
  if (n <= 7) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      a[i] = i + 1;
    }
    do {
      if (checkq(a)) {
        return a;
      }
    } while (next_permutation((a).begin(), (a).end()));
    assert(0);
    return {};
  } else {
    vector<int> a(7);
    for (int i = 0; i < 7; i++) {
      a[i] = i + 1;
    }
    do {
      if (checkq(a)) {
        break;
      }
    } while (next_permutation((a).begin(), (a).end()));
    a.resize(n);
    for (int i = 7; i < n; i++) {
      a[i] = i + 1;
    }
    int cur = 8;
    int ptr = 7;
    while (ptr < n) {
      int l = ptr;
      int r = min(n, l + cur);
      rotate(a.begin() + l, a.begin() + l + 1, a.begin() + r);
      cur *= 2;
      ptr = r;
    }
    return a;
  }
}
void run() {
  cin >> n;
  if (n % 2 == 0) {
    auto res = getp(n);
    assert(checkp(res));
    cout << "YES\n";
    print(res);
  } else {
    cout << "NO\n";
  }
  int k = 1;
  while (2 * k <= n) {
    k *= 2;
  }
  if (n == k || n < 6) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  auto res = getq(n);
  assert(checkq(res));
  print(res);
}

```