#include <bits/stdc++.h>
using namespace std;
int n;
int digits(int x) {
  int ret = 0;
  while (x > 0) x >>= 1, ret++;
  return ret;
}
int A[100005], B[100005];
void solve(int start, int len) {
  if (len == 0) return;
  int p = (1 << (digits(len) - 1));
  swap(B[start + p - 2], B[start + p - 1]);
  solve(start, p - 2);
  solve(start + p, len - p);
  for (int i = 0; i < len - p; i++) swap(B[start + i], B[start + p + i]);
}
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(0);
  cin >> n;
  if (n % 2)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) B[i] = i;
    solve(1, n);
    for (int i = 1; i <= n; i++) cout << B[i] << " ";
    cout << endl;
  }
  int m = n;
  while (m % 2 == 0) m >>= 1;
  if ((m == 1) || (n < 6))
    cout << "NO" << endl;
  else if (n == 6)
    cout << "YES\n3 6 2 5 1 4" << endl;
  else if (n == 7)
    cout << "YES\n3 6 2 5 1 7 4" << endl;
  else {
    cout << "YES" << endl;
    int d = digits(n);
    for (int i = (1 << (d - 1)); i < n; i++) A[i] = i + 1;
    A[n] = (1 << (d - 1));
    d--;
    while (d > 3) {
      for (int i = (1 << (d - 1)); i < (1 << d); i++) {
        A[i] = i + 1;
      }
      A[(1 << d) - 1] = 1 << (d - 1);
      d--;
    }
    vector<int> V = {0, 3, 6, 2, 5, 1, 7, 4};
    for (int i = 1; i <= 7; i++) A[i] = V[i];
    for (int i = 1; i <= n; i++) cout << A[i] << " ";
    cout << endl;
  }
}
