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