#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long Inf = 1ll << 60ll;
namespace io {
char buf[(1 << 23)], *p1 = buf, *p2 = buf, c;
int f;
template <typename T>
T read() {
  T x = 0;
  f = 0;
  c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (!isdigit(c))
    (c == '-') && (f = 1),
        c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin),
                          p1 == p2)
                 ? EOF
                 : *p1++);
  while (isdigit(c))
    x = x * 10 + (c & 15),
    c = (p1 == p2 &&
                 (p2 = (p1 = buf) + fread(buf, 1, (1 << 23), stdin), p1 == p2)
             ? EOF
             : *p1++);
  return f ? -x : x;
}
}  // namespace io
const int N = 100005;
int ans[N], n, tmp[N];
void solve(int m) {
  if (!m) return;
  int t = 1;
  while (t * 2 <= m) t *= 2;
  int le = t + t - m - 1;
  for (int i = le; i <= m; ++i) ans[i] = t + t - i - 1;
  solve(le - 1);
}
int main() {
  n = io::read<int>();
  if (n & 1) {
    puts("NO");
  } else {
    puts("YES");
    solve(n);
    for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
  }
  memset(ans, 0, sizeof(ans));
  int t = 1;
  while (t * 2 <= n) t *= 2;
  if (t == n) {
    puts("NO");
    return 0;
  } else {
    if (n <= 5) {
      puts("NO");
      return 0;
    }
    if (n == 6) {
      printf("YES\n3 6 2 5 1 4\n");
      return 0;
    }
    puts("YES");
    ans[1] = 7;
    ans[2] = 3;
    ans[3] = 2;
    ans[4] = 5;
    ans[5] = 6;
    ans[6] = 4;
    ans[7] = 1;
    int le = 8, tot, ri;
    while (le <= n) {
      tot = 0;
      ri = min(le * 2 - 1, n);
      for (int i = le; i <= ri; ++i) tmp[++tot] = i;
      for (int i = le; i < ri; ++i) ans[i] = tmp[i - le + 2];
      ans[ri] = tmp[1];
      le <<= 1;
    }
    for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
  }
  return 0;
}
