#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = n % 4 + 1; i < n; i += 4) {
    for (int x = i; x < i + 4; x += 2) {
      for (int j = 1; j < i; j++) {
        printf("%d %d\n", j, x);
      }
      printf("%d %d\n", x, x + 1);
      for (int j = i - 1; j > 0; j--) {
        printf("%d %d\n", j, x + 1);
      }
    }
    printf("%d %d\n", i, i + 3);
    printf("%d %d\n", i + 1, i + 2);
    printf("%d %d\n", i, i + 2);
    printf("%d %d\n", i + 1, i + 3);
  }
  return 0;
}
