#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const double EPS = 1e-9;
int ar[] = {1, -1, 0, 0, 1, 1, -1, -1};
int ac[] = {0, 0, 1, -1, 1, -1, 1, -1};
int p[200005];
int q[200005];
void solve1(int n) {
  int k = 1;
  if (n & 1) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  while (k <= n) k *= 2;
  k /= 2;
  int last = n + 1;
  while (k != 0) {
    for (int i = k; i < last; i++) {
      p[i] = k - (i - k + 1);
      p[k - (i - k + 1)] = i;
    }
    last = min(last, k - (last - k));
    k /= 2;
  }
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  cout << "\n";
}
void solve2(int n) {
  if (n < 6) {
    cout << "NO\n";
    return;
  }
  int k = 1;
  while (2 * k <= n) k *= 2;
  if (n == k) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  if (n == 6) {
    cout << "3 6 2 5 1 4\n";
    return;
  }
  for (int i = k; i < n; i++) q[i] = i + 1;
  q[n] = k;
  while (k != 4) {
    for (int i = k / 2; i < k - 1; i++) {
      q[i] = i + 1;
    }
    q[k - 1] = k / 2;
    k /= 2;
  }
  q[1] = 5;
  q[2] = 3;
  q[3] = 2;
  q[4] = 6;
  q[5] = 7;
  q[6] = 4;
  q[7] = 1;
  for (int i = 1; i <= n; i++) cout << q[i] << " ";
  cout << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  solve1(n);
  solve2(n);
  return 0;
}
