import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    if (N == 3) {
        writeln("Yes");
        foreach(i; 1..6) {
            writefln("%d %d", i, i+1);
        }
        return;
    }
    if (N < 3) {
        writeln("No");
        return;
    }
    bool oe = N%2 == 0 ? 1 : 0;
    if (N%2 == 0) {
        auto n = N;
        int cnt;
        while (n) {
            ++cnt;
            n >>= 1;
        }
        auto d = (1<<(cnt-1))-1;
        auto x = d, y = d;
        while (y <= N - ((N-2)/2%2 == 0 ? 2 : 0)) {
            x ^= ++y;
            if (x == N) {
                writeln("Yes");
                writefln("%d %d", d, N);
                writefln("%d %d", y, 2*N);
                --N;
                goto ok;
            }
        }
    } else {
        writeln("Yes");
        goto ok;
    }
    writeln("No");
    return;
    ok:

    auto is_even = (N-1)/2%2 == 0;
    foreach (i; 1..(is_even ? N-2 : N)) {
        writefln("%d %d", i, i+1);
    }
    writefln("%d %d", is_even ? N-2 : N, N+1+oe);
    if (is_even) {
        writefln("%d %d", N+1, N-1);
        writefln("%d %d", N-1, N);
        writefln("%d %d", N+1, 2*N+oe);
        writefln("%d %d", 2*N+oe, 2*N-1+oe);
    }
    int x = N+2+oe;
    int j = 5;
    while (j <= N+1+oe && (!is_even || (j < N-1 && x < 2*N-1+oe))) {
        writefln("%d %d", j, x);
        writefln("%d %d", x, x+1);
        x += 2;
        j += 2;
    }
    if (x <= N*2+oe && (!is_even || x+1 < 2*N-1+oe)) {
        writefln("%d %d", N+1, x);
        writefln("%d %d", x, x+1);
    }
}