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