#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
using namespace std;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
const int maxn = 1000 * 100 + 5;
const long long inf = 9223372036854775807;
const long long mod = 1e9 + 7;
const int lg = 20;
long long n, flag;
void sag(int x1, int x2, int x3, int x4) {
  cout << x1 << " " << x2 << endl << x3 << " " << x4 << endl;
  cout << x1 << " " << x4 << endl << x2 << " " << x3 << endl;
  cout << x1 << " " << x3 << endl << x2 << " " << x4 << endl;
}
void sag2(int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8) {
  cout << x1 << " " << x6 << endl
       << x2 << " " << x7 << endl
       << x3 << " " << x8 << endl
       << x4 << " " << x5 << endl;
  cout << x1 << " " << x5 << endl
       << x2 << " " << x6 << endl
       << x3 << " " << x7 << endl
       << x4 << " " << x8 << endl;
  cout << x1 << " " << x7 << endl
       << x2 << " " << x8 << endl
       << x3 << " " << x5 << endl
       << x4 << " " << x6 << endl;
  cout << x1 << " " << x8 << endl
       << x2 << " " << x5 << endl
       << x3 << " " << x6 << endl
       << x4 << " " << x7 << endl;
}
void sag3(int x1, int x2, int x3, int x4, int x5) {
  cout << x1 << " " << x3 << endl << x2 << " " << x4 << endl;
  cout << x1 << " " << x5 << endl << x1 << " " << x2 << endl;
  cout << x2 << " " << x5 << endl << x3 << " " << x5 << endl;
  cout << x3 << " " << x4 << endl << x4 << " " << x5 << endl;
  cout << x1 << " " << x4 << endl << x2 << " " << x3 << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  if (n % 4 == 2 || n % 4 == 3) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  if (n % 4) {
    n--;
    for (int i = 1; i <= n; i += 4) {
      sag3(i, i + 1, i + 2, i + 3, n + 1);
    }
  } else {
    for (int i = 1; i <= n; i += 4) {
      sag(i, i + 1, i + 2, i + 3);
    }
  }
  n -= n % 4;
  for (int i = 1; i <= n; i += 4) {
    for (int j = i + 4; j <= n; j += 4) {
      sag2(i, i + 1, i + 2, i + 3, j, j + 1, j + 2, j + 3);
    }
  }
}
