#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (1 << 20);
int n;
void read() { cin >> n; }
vector<pair<int, int> > change_list = {
    {0, 0}, {0, 1}, {0, 2}, {1, 0}, {1, 3}, {0, 3}, {1, 2}, {2, 0},
    {3, 1}, {2, 1}, {1, 1}, {2, 2}, {3, 0}, {3, 3}, {2, 3}, {3, 2},
};
void solve() {
  if (n % 4 >= 2) {
    cout << "NO" << '\n';
    return;
  }
  cout << "YES" << '\n';
  bool odd_flag = n % 2;
  for (int i = 0; i < (n / 4); i++) {
    int a = i * 4 + 1, b = i * 4 + 2, c = i * 4 + 3, d = i * 4 + 4;
    if (odd_flag) cout << a << " " << n << '\n';
    cout << a << " " << c << '\n';
    if (odd_flag) cout << c << " " << n << '\n';
    if (odd_flag) cout << b << " " << n << '\n';
    cout << b << " " << d << '\n';
    if (odd_flag) cout << d << " " << n << '\n';
    cout << a << " " << b << '\n';
    cout << c << " " << d << '\n';
    cout << a << " " << d << '\n';
    cout << b << " " << c << '\n';
  }
  for (int i = 0; i < (n / 4); i++)
    for (int j = i + 1; j < (n / 4); j++)
      for (auto it : change_list)
        cout << 4 * i + 1 + it.first << " " << 4 * j + 1 + it.second << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
