#include <bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define rep(i,n) for(int i=0; i<(int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<ll, ll>;

//constexpr ll mod = 998244353;
constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

vector<int> ans;
set<int> st;

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n; cin >> n;
  if (__builtin_popcount(n)==1) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;

  if (n%4==3) {
    for (int k = 0; k * 4 <= n + 4; k++) {
      if (k != 0) {
        ans.push_back(4 * k);
      }
      ans.push_back(4 * k + 1);
      ans.push_back(4 * k + 2);
      ans.push_back(4 * k + 3);
      if (k != 0) {
        ans.push_back(4 * k + n);
      }
      ans.push_back(4 * k + 1 + n);
      ans.push_back(4 * k + 2 + n);
      ans.push_back(4 * k + 3 + n);
    }


    for (int i = 0; i < 2 * n - 1; i++) {
      cout << ans[i] << ' ' << ans[i + 1] << '\n';
    }
    return 0;
  }

  if (n%4==1) {
    for (int k = 0; k * 4 <= n; k++) {
      ans.push_back(4 * k + 2);
      ans.push_back(4 * k + 3);
      ans.push_back(4 * k + 4);
      ans.push_back(4 * k + 5);
      ans.push_back(4 * k + 2 + n);
      ans.push_back(4 * k + 3 + n);
      ans.push_back(4 * k + 4 + n);
      ans.push_back(4 * k + 5 + n);
    }
    for (int i = 0; i < 2 * n - 3; i++) {
      cout << ans[i] << ' ' << ans[i + 1] << '\n';
    }
    cout << 1 << ' ' << 2 << '\n';
    cout << 3 << ' ' << 1 + n << '\n';
    return 0;
  }

  int k=30;
  while((n&(1<<k))==0) {
    k--;
  }

  int p=(1<<k); // even
  int q=(n^p); // even (p>q)

  for(int i=0; i<n/2; i++) {
    st.insert(i*2);
  }
  if (n%4==0) {
    ans.push_back(1);
    ans.push_back(p+1);
    ans.push_back(p);
    ans.push_back(1+n);
    ans.push_back(p+1+n);
    ans.push_back(p+n);
    st.erase(0);
    st.erase(p);
    st.erase(q);
    auto it = st.begin();
    int r=*it;
    ans.push_back(q);
    ans.push_back(q+1);
    ans.push_back(r);
    ans.push_back(r+1);
    ans.push_back(q+n);
    ans.push_back(q+1+n);
    ans.push_back(r+n);
    ans.push_back(r+1+n);
    st.erase(r);


    it = st.begin();
    while(it != st.end()) {
      int a = *it;
      it++;
      int b = *it;
      it++;
      ans.push_back(a);
      ans.push_back(a+1);
      ans.push_back(b);
      ans.push_back(b+1);
      ans.push_back(a+n);
      ans.push_back(a+1+n);
      ans.push_back(b+n);
      ans.push_back(b+1+n);
    }

    int t = ans.size();
    for (int i = 0; i < t-1; i++) {
      cout << ans[i] << ' ' << ans[i + 1] << '\n';
    }
    cout << n << ' ' << p+n << '\n';
    cout << n+n << ' ' << q << '\n';
    return 0;
  }

  st.erase(0);

  ans.push_back(p+1);
  ans.push_back(p);
  ans.push_back(q);
  ans.push_back(q+1);
  ans.push_back(p+1+n);
  ans.push_back(p+n);
  ans.push_back(q+n);
  ans.push_back(q+1+n);
  st.erase(p);
  st.erase(q);
  auto it = st.begin();
  while(it != st.end()) {
    int a = *it;
    it++;
    int b = *it;
    it++;
    ans.push_back(a);
    ans.push_back(a+1);
    ans.push_back(b);
    ans.push_back(b+1);
    ans.push_back(a+n);
    ans.push_back(a+1+n);
    ans.push_back(b+n);
    ans.push_back(b+1+n);
  }

  int t = ans.size();
  for (int i = 0; i < t-1; i++) {
    cout << ans[i] << ' ' << ans[i + 1] << '\n';
  }
  cout << n << ' ' << p << '\n';
  cout << n+n << ' ' << q << '\n';
  cout << 1 << ' ' << p+1 << '\n';
  cout << 1+n << ' ' << p << '\n';
}

Measured memory_bytes: 6004