#include <bits/stdc++.h>
void solve(int x) {
  for (int i = (x); i >= (1); i--) printf("%d %d\n", i, x + 1);
  for (int i = (x); i >= (1); i--) printf("%d %d\n", i, x + 2);
  printf("%d %d\n", x + 1, x + 3), printf("%d %d\n", x + 2, x + 4);
  for (int i = (1); i <= (x); i++) printf("%d %d\n", i, x + 4);
  for (int i = (1); i <= (x); i++) printf("%d %d\n", i, x + 3);
  printf("%d %d\n", x + 1, x + 4), printf("%d %d\n", x + 2, x + 3);
  printf("%d %d\n", x + 1, x + 2), printf("%d %d\n", x + 3, x + 4);
}
int main() {
  int n;
  scanf("%d", &n);
  if (n % 4 == 2 || n % 4 == 3) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int x = n % 4; x < n; x += 4) solve(x);
}
