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