#include <bits/stdc++.h>
#include <unistd.h>

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
// #define mp make_pair
//#define endl '\n'


void solve1(int n, int m) {
  int x = m ^ (m + 1);
  set<int> st;
  st.insert(x);
  st.insert(1);
  st.insert(3);
  vi retu = {x, 1, 3};
  
  rep1 (i, m) {
    if (not st.count(i)) {
      retu.push_back(i);
    }
  }
  rep (i, m) {
    retu.push_back(retu[i] + n);
  }
  cout << "Yes" << endl;
  rep (i, retu.size() - 1) {
    cout << retu[i] << " " << retu[i + 1] << endl;
  }
  ll m2 = m;
  int i = 0;
  while (m2 < n) {
    m2++;
    cout << m2 << " " << m << endl;
    cout << m2 + n << " " << retu[i] + n << endl;
    i++;
  }
}

void solve_easy(int n) {
  vi retu;
  rep1 (i, n) retu.push_back(i);
  rep1 (i, n) retu.push_back(i + n);
  cout << "Yes" << endl;
  rep (i, retu.size() - 1) {
    cout << retu[i] << " " << retu[i + 1] << endl;
  }
}

void solve_hard1 (int n, int m) {
  vi retu;
  rep1 (i, m) retu.push_back(i);
  rep1 (i, m) retu.push_back(i + n);
  cout << "Yes" << endl;
  rep (i, retu.size() - 1) {
    cout << retu[i] << " " << retu[i + 1] << endl;
  }

  cout << m + 1 << " " << m + 2 << endl;
  cout << m + 2 << " " << 1 << endl;
  cout << 1 << " " << m + 1 + n << endl;
  cout << m + 1 + n << " " << m + 2 + n  << endl;
}


void solve_hard2 (int n, int m) {
  vi retu1, retu2;
  rep1 (i, 3) retu1.push_back(i);
  rep1 (i, 3) retu1.push_back(i + n);
  retu2.push_back(4); retu2.push_back(6);
  for (int i = 4; i <= m; i++) {
    if (i == 4 or i == 6) continue;
    retu2.push_back(i);
  }
  retu2.push_back(4 + n); retu2.push_back(6 + n);
  for (int i = 4; i <= m; i++) {
    if (i == 4 or i == 6) continue;
    retu2.push_back(i + n);
  }
  
  cout << "Yes" << endl;
  rep (i, retu1.size() - 1) {
    cout << retu1[i] << " " << retu1[i + 1] << endl;
  }
  rep (i, retu2.size() - 1) {
    cout << retu2[i] << " " << retu2[i + 1] << endl;
  }

  int ei = m + 1, ni = m + 2, te = m + 3;
  cout << ni << " " << ei << endl;
  cout << te << " " << ei << endl;
  cout << ei << " " << 1 << endl;
  cout << 1 << " " << ni + n << endl;
  cout << ni + n << " " << ei + n << endl;
  cout << ei << " " << 4 << endl;
  cout << 6 << " " << te + n << endl;
}

void solve6(int n) {
  cout << "Yes" << endl;
  vi retu = {2, 3, 1, 2 + n, 3 + n, 1 + n};
  rep (i, retu.size() - 1) {
    cout << retu[i] << " " << retu[i + 1] << endl;
  }
  cout << 5 << " " << 4 << endl;
  cout << 6 << " " << 4 << endl;
  cout << 4 << " " << 2 << endl;
  cout << 2 << " " << 6 + n << endl;
  cout << 6 + n << " " << 4 + n << endl;
  cout << 3 << " " << 5 + n << endl;
}



int main() {
  ll n;
  cin >> n;
  ll x = 1;
  set<ll> two_pow;
  while (x <= 4 * n) {
    two_pow.insert(x);
    if (x == n) {
      cout << "No" << endl;
      return 0;
    }
    x *= 2;
  }
  
  ll m = (n + 1) / 4 * 4 - 1;
  if (n == m) {
    solve_easy(n);
    return 0;
  }
  if (not two_pow.count(m + 1)) {
    solve1(n, m);
    return 0;
  }
  else {
    if (n % 4 == 1) {
      solve_hard1(n, m);
    }
    else if (n % 4 == 2) {
      if (n == 6) {
        solve6(n);
      }
      else {
        solve_hard2(n, m);
      }
    }
  }
}


Measured memory_bytes: 3700