#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int inf = (int)1e9 + 123;
const long long infl = (long long)1e18 + 123;
const double eps = 1e-10;
const int MAX_N = (int)5e5 + 123;
int main() {
  int n;
  scanf("%d", &n);
  if (n * (n - 1) / 2 % 2 != 0) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = n; i > 1; i -= 4) {
    int j = i - 4;
    for (int k = 1; k <= j; k++) printf("%d %d\n", k, i - 3);
    printf("%d %d\n", i - 3, i - 2);
    for (int k = j; k > 0; k--) printf("%d %d\n", k, i - 2);
    printf("%d %d\n", i - 3, i);
    printf("%d %d\n", i - 2, i - 1);
    printf("%d %d\n", i - 3, i - 1);
    printf("%d %d\n", i - 2, i);
    for (int k = 1; k <= j; k++) printf("%d %d\n", k, i - 1);
    printf("%d %d\n", i - 1, i);
    for (int k = j; k > 0; k--) printf("%d %d\n", k, i);
  }
  return 0;
}
