#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double PI = acos(-1.0);
const auto INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
const int MAXN = 1e5 + 10;
int vis[MAXN];
int main() {
  int n, y = 1;
  scanf("%d", &n);
  while ((y << 1) <= n) y <<= 1;
  if (n & 1)
    puts("NO");
  else {
    puts("YES");
    int t = y;
    for (int i = n; i >= 1; i--) {
      if (t > i) t >>= 1;
      if (!vis[i]) {
        int x = t - (i - t) - 1;
        vis[i] = x;
        vis[x] = i;
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%d ", vis[i]);
    }
    puts("");
  }
  if (n == y || n < 6)
    puts("NO");
  else {
    puts("YES");
    if (n == 6)
      puts("3 6 2 5 1 4");
    else {
      printf("7 3 6 5 1 2 4 ");
      for (int i = 8; i <= n;) {
        int j = min(i << 1, n + 1);
        for (int k = i; k < j - 1; k++) printf("%d ", k + 1);
        printf("%d ", i);
        i = j;
      }
    }
  }
  return 0;
}
