#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  int mv = 1;
  while (mv * 2 <= n) mv *= 2;
  if (n == 6 || mv == 0 || (mv - n) % 2 == 0) {
    puts("No");
    return 0;
    assert(false);
  }
  puts("Yes");
  vector<pair<vector<int>, bool>> vds;
  if ((mv - n + 1) % 2 == 0) {
    vector<int> av;
    int kv = 0;
    for (int i = ((int)(mv)); i <= ((int)(n)); i++) {
      av.push_back(i);
      kv ^= i;
    }
    if (kv != 0) {
      av.push_back(kv);
      vds.push_back(pair<vector<int>, bool>(av, false));
      av = vector<int>();
    }
    for (int i = ((int)(1)); i <= ((int)(mv - 1)); i++) {
      av.push_back(i);
    }
    vds.push_back(pair<vector<int>, bool>(av, true));
  }
  if (n == 3) {
    vds.clear();
    vector<int> av;
    av.push_back(1);
    av.push_back(2);
    av.push_back(3);
    vds.push_back(pair<vector<int>, bool>(av, true));
  }
  for (auto vb : vds) {
    vector<int> v;
    bool b;
    tie(v, b) = vb;
    int ls = v.size();
    if (ls <= 1) continue;
    assert(ls != 2 || !b);
    printf("%d %d\n", v[ls - 1], v[0] + n);
    for (int i = 0; i < ((int)(ls - 1)); i++) {
      printf("%d %d\n", v[i], v[i + 1]);
      if (i < ls - 2 || b) {
        printf("%d %d\n", v[i] + n, v[i + 1] + n);
      }
    }
  }
  return 0;
}
