#include <bits/stdc++.h>
using namespace std;
int A[100005];
void solveP(int N) {
  if (!N) return;
  int k = 1 << (31 - __builtin_clz(N));
  for (int i = k - 1; i <= N; ++i) A[i] = k + k - i - 1;
  for (int i = k + 1; i <= N; ++i) A[k + k - 1 - i] = i;
  solveP(k + k - 2 - N);
}
int main() {
  int N;
  scanf("%d", &N);
  if (N % 2 == 0) {
    solveP(N);
    printf("YES\n");
    for (int i = 1; i <= N; ++i) printf("%d ", A[i]);
    printf("\n");
  } else {
    printf("NO\n");
  }
  if (N < 6 || (1 << (31 - __builtin_clz(N))) == N)
    printf("NO\n");
  else {
    printf("YES\n");
    if (N == 6)
      printf("3 6 1 5 4 2\n");
    else {
      for (int i = 8; i <= N; i += 2) {
        A[i] = i + 1;
        A[i + 1] = i;
      }
      if (N % 2 == 0) {
        A[N] = N - 2;
        A[N - 1] = N;
        A[N - 2] = N - 1;
      }
      printf("3 6 1 5 4 7 2");
      for (int i = 8; i <= N; ++i) printf(" %d", A[i]);
    }
  }
}
