#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct UnionFind {
    int N;
    vector<int> node;

    UnionFind(){}
    UnionFind(int N) : N(N), node(N,-1) {}

    void init(int x) {
        node.assign(x,-1);
        N = x;
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (node[x] > node[y]) swap(x,y);
        node[x] += node[y];
        node[y] = x;
        N--;
        return true; 
    }

    bool same(int x, int y) {return root(x) == root(y);}

    int root(int x) {
        if (node[x] < 0) return x;
        return node[x] = root(node[x]);
    }

    int size(int x) {return -node[root(x)];}

    int count() const {return N;}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;

    if (popcount(N)==1) {
        cout << "No" << ln;
        return 0;
    }
    cout << "Yes" << ln;

    vector<pii> ans;
    int M = (N+1)/4*4;//4n
    for (int i = 4; i < M; i += 4) {
        ans.emplace_back(i,i+1);
        ans.emplace_back(i+1,i+2);
        ans.emplace_back(i+2,i+3);
        ans.emplace_back(i+3,N+i);
        ans.emplace_back(N+i,N+i+1);
        ans.emplace_back(N+i+1,N+i+2);
        ans.emplace_back(N+i+2,N+i+3);
    }
    if (N%4==3) {
        ans.emplace_back(1,2);
        ans.emplace_back(2,3);
        ans.emplace_back(3,N+1);
        ans.emplace_back(N+1,N+2);
        ans.emplace_back(N+2,N+3);
        for (int i = 4; i < M; i += 4) {
            ans.emplace_back(1,i);
        }
    } else if (N%4==1) {
        ans.emplace_back(1,2);
        ans.emplace_back(2,3);
        ans.emplace_back(3,N+1);
        ans.emplace_back(N+1,N+2);
        ans.emplace_back(N+2,N+3);
        for (int i = 4; i < M; i += 4) {
            ans.emplace_back(1,i);
        }
        ans.emplace_back(M,M+1);
        ans.emplace_back(M+1,1);
        ans.emplace_back(1,N+M);
        ans.emplace_back(N+M,N+M+1);
    } else if (N%4==0) {
        ans.emplace_back(1,2);
        ans.emplace_back(2,3);
        ans.emplace_back(3,N+1);
        ans.emplace_back(N+1,N+2);
        ans.emplace_back(N+2,N+3);
        UnionFind uf(N+1);
        for (int i = 4; i < M; i += 4) {
            uf.merge(i,i+1);
            uf.merge(i+1,i+2);
            uf.merge(i+2,i+3);
        }
        uf.merge(1,2);
        uf.merge(2,3);
        ans.emplace_back(N,N-1);
        ans.emplace_back(N-1,3);
        uf.merge(N,N-1);
        uf.merge(N-1,3);
        int K = (N^(N-1))-3;
        int cur = 3;
        for (int bit = 2; bit < 20; bit++) {
            if (K&(1<<bit)) {
                ans.emplace_back(cur,1<<bit);
                uf.merge(cur,1<<bit);
                cur = 1<<bit;
            }
        }
        ans.emplace_back(cur,N*2);
        for (int i = 1; i <= N; i++) {
            if (uf.merge(1,i)) {
                ans.emplace_back(1,i);
            }
        }
    } else {
        ans.emplace_back(1,N-1);
        ans.emplace_back(N-1,N-2);
        ans.emplace_back(N-2,2);
        ans.emplace_back(N-2,N+1);
        ans.emplace_back(N+1,3);
        ans.emplace_back(N+1,2*N-1);
        ans.emplace_back(N-2,N);
        ans.emplace_back(N,N+3);
        ans.emplace_back(N,N+2);
        ans.emplace_back(N+2,2*N-2);
        ans.emplace_back(2*N-2,2*N);
        for (int i = 4; i < M; i += 4) {
            ans.emplace_back(1,i);
        }
    }

    for (auto i : ans) print(i.first,i.second);
}


Measured memory_bytes: 5388