#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int N;
int ans1[MAXN];
int ans2[MAXN];
int go(int x) {
  int power = 1;
  while (power * 2 <= x) power *= 2;
  for (int i = 0; power + i <= x; i++) {
    ans1[power + i] = power - 1 - i;
    ans1[power - 1 - i] = power + i;
  }
  return 2 * power - 1 - x - 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N;
  if (N % 2 == 1)
    cout << "NO\n";
  else {
    int temp = N;
    while (temp > 1) temp = go(temp);
    cout << "YES\n";
    for (int i = 1; i <= N; i++) cout << ans1[i] << " ";
    cout << "\n";
  }
  ans2[1] = 7;
  ans2[2] = 3;
  ans2[3] = 6;
  ans2[4] = 5;
  ans2[5] = 1;
  ans2[6] = 2;
  ans2[7] = 4;
  if (N <= 5 || ((N & (N - 1)) == 0))
    cout << "NO\n";
  else if (N == 6) {
    cout << "YES\n";
    cout << "3 6 2 5 1 4\n";
  } else {
    cout << "YES\n";
    for (int i = 8; i < N; i *= 2)
      for (int j = i; j < 2 * i && j <= N; j++) {
        if (j == 2 * i - 1 || j == N)
          ans2[j] = i;
        else
          ans2[j] = j + 1;
      }
    for (int i = 1; i <= N; i++) cout << ans2[i] << " ";
    cout << "\n";
  }
  return 0;
}
