#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
inline int input() {
  int x;
  char ch;
  while (!isdigit(ch = getchar()))
    ;
  for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48))
    ;
  return x;
}
inline void chkmin(int &x, int y) { x = x < y ? x : y; }
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n, m = 0;
  for (int i = 0; i <= 30; ++i)
    if ((1 << i) == n) return puts("No"), 0;
  puts("Yes");
  for (int i = 1, tmp = 0; i <= n; ++i) {
    tmp ^= i;
    if (!tmp) m = i;
  }
  if ((n - m) & 1) {
    int tmp = n ^ m;
    if (tmp < m) {
      for (int i = tmp - 1; i; --i) {
        printf("%d %d\n", i, i + 1);
        printf("%d %d\n", n + i, n + i + 1);
      }
      printf("1 %d\n", tmp + 1);
      printf("%d %d\n", n + 1, n + tmp + 1);
      for (int i = tmp + 1; i < m; ++i) {
        printf("%d %d\n", i, i + 1);
        printf("%d %d\n", n + i, n + i + 1);
      }
      printf("%d %d\n", m, n + tmp);
      printf("%d %d\n", n, m);
      printf("%d %d\n", n + n, n + tmp);
    } else {
      for (int i = 1; i < m; ++i) {
        printf("%d %d\n", i, i + 1);
        printf("%d %d\n", n + i, n + i + 1);
      }
      printf("%d %d\n", m, n + 1);
      printf("%d %d\n", n, tmp);
      printf("%d %d\n", n + n, m - 1);
    }
    int Xor = 0;
    for (int i = m + 1; i < n; ++i) Xor ^= i;
    for (int i = m + 1; i < n - 1; ++i) printf("%d %d\n", i, i + 1);
    if (Xor) printf("%d %d\n", n - 1, Xor);
    if (Xor) printf("%d %d\n", Xor, n + m + 1);
    for (int i = n + m + 1; i < n + n - 1; ++i) printf("%d %d\n", i, i + 1);
  } else {
    for (int i = 1; i < m; ++i) printf("%d %d\n", i, i + 1);
    printf("%d %d\n", m, n + 1);
    for (int i = n + 1; i < n + m; ++i) printf("%d %d\n", i, i + 1);
    int Xor = 0;
    for (int i = m + 1; i <= n; ++i) Xor ^= i;
    for (int i = m + 1; i < n; ++i) printf("%d %d\n", i, i + 1);
    if (Xor) printf("%d %d\n", n, Xor);
    if (Xor) printf("%d %d\n", Xor, n + m + 1);
    for (int i = n + m + 1; i < n << 1; ++i) printf("%d %d\n", i, i + 1);
  }
  return 0;
}
