#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(vector<T> s) {
  for (T x : s) cout << x << " ";
  cout << endl;
}
bool isPower(int a) { return !((a - 1) & a); }
int main() {
  srand(17);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int cur = 0;
  for (int i = 1; i <= n; i++) cur ^= i;
  if (!isPower(cur)) {
    cout << "No\n";
    return 0;
  }
  vector<int> s;
  for (int i = 1; i <= n; i++) {
    if (i != cur) s.push_back(i);
  }
  sort(s.begin(), s.end(), [&](int a, int b) {
    if (isPower(a) != isPower(b)) return a < b;
    if (!isPower(a)) return a < b;
    if (((a & cur) == a && (b & cur) == b) ||
        ((a & cur) != a && (b & cur) != b))
      return a < b;
    return (a < b);
  });
  cout << "Yes\n";
  for (int i = 0; i < s.size() - 1; i++) {
    cout << s[i] << " " << s[i + 1] << "\n";
    cout << s[i] + n << " " << s[i + 1] + n << "\n";
  }
  cout << s.back() << " " << s[0] + n << "\n";
  if (cur != 0) {
    cout << cur << " " << s[0] << "\n";
    int t = 0;
    for (int i : s) {
      t ^= i;
      if (t == cur) {
        cout << i << " " << cur + n << endl;
        return 0;
      }
    }
  }
  return 0;
}
