// Template
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <cmath>
#include <complex>
#define rep(i, x) for (int i = 0; i < (x); ++i)
#define rng(i, x, y) for (int i = (x); i < (y); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using namespace std;
using ll = long long;
constexpr int inf = 1001001001;
constexpr ll INF = 3003003003003003003;
template <typename T> inline bool chmin(T &x, const T &y) {if (x > y) {x = y; return 1;} return 0;}
template <typename T> inline bool chmax(T &x, const T &y) {if (x < y) {x = y; return 1;} return 0;}

// Main Code
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    if (n == 1 || n == 2) {
        cout << "No\n";
    } else if (n == 3) {
        cout << "Yes\n1 2\n2 3\n3 4\n4 5\n5 6\n";
    } else {
        int mx = 0;
        rep(i, 30) {
            if ((n >> i) & 1) chmax(mx, 1 << i);
        }
        int m = n - mx;
        if (m == 0) {
            cout << "No\n";
        } else {
            cout << "Yes\n";
            if (m & 1) {
                int x = 0;
                rng(i, mx + 1, n + 1) {
                    x ^= (i - mx);
                    cout << i - 1 << " " << i << "\n";
                }
                if (x == 0) cout << n << " " << mx + n << "\n";
                else cout << n << " " << x << "\n" << x << " " << mx + n << "\n";
                rng(i, mx + 1, n + 1) cout << i + n - 1 << " " << i + n << "\n";
                if (x == 0) cout << 2 * n << " " << 1 << "\n";
                rng(i, 2, mx) cout << i - 1 << " " << i << "\n";
                cout << mx - 1 << " " << 1 + n << "\n";
                rng(i, 2, mx) cout << i + n - 1 << " " << i + n << "\n";
            } else {
                int x = 0;
                rng(i, mx + 1, n) {
                    x ^= (i - mx);
                    cout << i - 1 << " " << i << "\n";
                }
                if (x == 0) cout << n - 1 << " " << mx + n << "\n";
                else cout << n - 1 << " " << x << "\n" << x << " " << mx + n << "\n";
                rng(i, mx + 1, n) cout << i + n - 1 << " " << i + n << "\n";
                int y = (n - mx) ^ x;
                if (x == 0) cout << mx + n << " " << y << "\n";
                else if (y != 0) cout << x << " " << y << "\n";
                cout << n << " " << mx + n << "\n";
                if (y == 0) cout << x << " " << 2 * n << "\n";
                else cout << y << " " << 2 * n << "\n";
                vector<int> vec;
                if (x != 0) vec.pb(x);
                if (y != 0) vec.pb(y);
                rng(i, 1, mx) {
                    if (i != x && i != y) vec.pb(i);
                }
                if (x != 0 && y != 0) rng(i, 2, sz(vec)) cout << vec[i - 1] << " " << vec[i] << "\n";
                else rng(i, 1, sz(vec)) cout << vec[i - 1] << " " << vec[i] << "\n";
                cout << vec[sz(vec) - 1] << " " << vec[0] + n << "\n";
                rng(i, 1, sz(vec)) cout << vec[i - 1] + n << " " << vec[i] + n << "\n";
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3724