#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 4 >= 2) return puts("NO"), 0;
  puts("YES");
  for (int i = 1; i < n; i += 4) {
    if (n % 4)
      printf("%d %d\n", i + 2, n), printf("%d %d\n", i + 2, i + 3),
          printf("%d %d\n", i + 3, n);
    else
      printf("%d %d\n", i + 2, i + 3);
    printf("%d %d\n", i, i + 2), printf("%d %d\n", i + 1, i + 3),
        printf("%d %d\n", i + 1, i + 2), printf("%d %d\n", i, i + 3);
    if (n % 4)
      printf("%d %d\n", i, n), printf("%d %d\n", i, i + 1),
          printf("%d %d\n", i + 1, n);
    else
      printf("%d %d\n", i, i + 1);
  }
  for (int i = 1; i < n; i += 4) {
    for (int j = i + 4; j < n; j += 4) {
      printf("%d %d\n", i + 3, j + 2), printf("%d %d\n", i + 2, j + 2),
          printf("%d %d\n", i + 3, j + 1), printf("%d %d\n", i, j + 1);
      printf("%d %d\n", i + 1, j + 3), printf("%d %d\n", i + 2, j + 3),
          printf("%d %d\n", i + 1, j + 2), printf("%d %d\n", i + 1, j + 1);
      printf("%d %d\n", i + 3, j), printf("%d %d\n", i + 3, j + 3),
          printf("%d %d\n", i, j + 2), printf("%d %d\n", i, j + 3);
      printf("%d %d\n", i + 2, j), printf("%d %d\n", i + 2, j + 1),
          printf("%d %d\n", i + 1, j), printf("%d %d\n", i, j);
    }
  }
}
