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