#include <bits/stdc++.h>
using namespace std;
long long n;
void c(int a, int x, int y) { cout << a + x << " " << a + y << endl; }
void f4_6(int i) {
  c(i, 1, 2);
  c(i, 3, 4);
  c(i, 1, 3);
  c(i, 2, 4);
  c(i, 1, 4);
  c(i, 2, 3);
}
void f4_4(int i, int j) {
  cout << i + 1 << " " << j + 1 << endl;
  cout << i + 2 << " " << j + 2 << endl;
  cout << i + 1 << " " << j + 2 << endl;
  cout << i + 2 << " " << j + 1 << endl;
}
void f5_10(int i) {
  c(i, 2, 4);
  c(i, 1, n - i);
  c(i, 3, n - i);
  c(i, 1, 3);
  c(i, 2, n - i);
  c(i, 1, 4);
  c(i, 3, 4);
  c(i, 4, n - i);
  c(i, 2, 3);
  c(i, 1, 2);
}
int main() {
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << "NO";
    return 0;
  }
  if (n % 4 == 0 || n % 4 == 1) cout << "YES" << endl;
  if (n % 4 == 0) {
    for (int i = 0; i < n - 1; i += 4) {
      f4_6(i);
    }
    for (int i = 0; i < n - 3; i += 2) {
      for (int j = i + 2; j < n - 1; j += 2) {
        if (i + 2 == j && i % 4 == 0)
          continue;
        else
          f4_4(i, j);
      }
    }
  }
  if (n % 4 == 1) {
    for (int i = 0; i < n - 2; i += 4) {
      f5_10(i);
    }
    for (int i = 0; i < n - 3; i += 2) {
      for (int j = i + 2; j < n - 1; j += 2) {
        if (i + 2 == j && i % 4 == 0)
          continue;
        else
          f4_4(i, j);
      }
    }
  }
  return 0;
}
