#include <bits/stdc++.h>
using namespace std;
int f[200005], g[200005];
void solve(int n) {
  if (n == 2) {
    f[1] = 2;
    f[2] = 1;
    return;
  }
  int i;
  if ((n >> 1) & 1) {
    solve((n >> 1) - 1);
    g[1] = n;
    for (i = 3; i <= n; i += 2) g[i] = f[i >> 1] << 1;
    for (i = 1; i <= n; i += 2) g[g[i]] = i;
    for (i = 1; i <= n; ++i) f[i] = g[i];
  } else {
    solve(n >> 1);
    for (i = 3; i <= n; i += 2) g[i] = f[i >> 1] << 1;
    g[1] = f[n >> 1] << 1;
    for (i = 1; i <= n; i += 2) g[g[i]] = i;
    for (i = 1; i <= n; ++i) f[i] = g[i];
  }
}
int n, i;
void sol(int n) {
  if (n & 1) {
    f[1] = 3;
    f[2] = 6;
    f[3] = 1;
    f[4] = 5;
    f[5] = 4;
    f[6] = 7;
    f[7] = 2;
    for (i = 8; i <= n; ++i) f[i] = i ^ 1;
    return;
  }
  if (n <= 11) {
    if (n == 6) {
      f[1] = 3;
      f[2] = 6;
      f[3] = 1;
      f[4] = 5;
      f[5] = 4;
      f[6] = 2;
    }
    if (n == 10) {
      f[1] = 3;
      f[2] = 6;
      f[3] = 1;
      f[4] = 5;
      f[5] = 4;
      f[6] = 2;
      f[7] = 9;
      f[8] = 10;
      f[9] = 7;
      f[10] = 8;
    }
    return;
  }
  sol(n >> 1);
  for (i = 1; i + 2 <= n; i += 2) g[i] = i + 2;
  g[i] = 1;
  for (i = 2; i <= n; i += 2) g[i] = f[i >> 1] << 1;
  for (i = 1; i <= n; ++i) f[i] = g[i];
}
int main() {
  cin >> n;
  if (n > 1 && !(n & 1)) {
    cout << "YES\n";
    solve(n);
    for (i = 1; i <= n; ++i) cout << f[i] << " ";
    cout << "\n";
  } else {
    cout << "NO\n";
  }
  if (n < 6 || ((n & -n) == n)) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    memset(f, 0, sizeof(f));
    memset(g, 0, sizeof(g));
    sol(n);
    for (i = 1; i <= n; ++i) cout << f[i] << " ";
    cout << '\n';
  }
}
