#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<pair<int,ll>> vec;
typedef vector<string> svec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-8;

void solve() {
	int n; cin >> n;
	int cop = n;
	while (cop % 2 == 0)cop /= 2;
	if (cop == 1) {
		cout << "No" << endl; return;
	}
	vector<P> ans;
	if (n % 4 == 3) {
		cout << "Yes" << endl;
		rep1(i, 2*n-1) {
			cout << i << " " << i + 1 << endl;
		}
		return;
	}
	else if (n % 4 == 0) {
		int r1 = 0;
		rep(j, 30) {
			if (n&(1 << j)) {
				r1 = (1 << j);
				break;
			}
		}
		int r2 = r1 ^ n;
		ans.push_back({ r1,r2 });
		ans.push_back({ r2,n });
		ans.push_back({ n,r1+n });
		ans.push_back({ r1+n,r2+n });
		ans.push_back({ r2+n,n+n });
		rep1(i, 3) {
			ans.push_back({ r1 + i - 1,r1 + i });
			ans.push_back({ r2 + i - 1,r2 + i });
		}
		ans.push_back({ r1 + n,r1 + n + 3 });
		ans.push_back({ r1 + n+3,r1 + n + 2 });
		ans.push_back({ r1 + n+2,r1 + n + 1 });
		ans.push_back({ r2 + n,r2 + n + 3 });
		ans.push_back({ r2 + n + 3,r2 + n + 2 });
		ans.push_back({ r2 + n + 2,r2 + n + 1 });
		int tmp = 0;
		ans.push_back({ r1,1 });
		ans.push_back({ 1,2 });
		ans.push_back({ 2,3 });
		tmp = 4; int loc = 3;
		while (tmp < n) {
			if (tmp == r1 || tmp == r2) {
				tmp += 4; continue;
			}
			ans.push_back({ loc,tmp });
			ans.push_back({ tmp,tmp + 1 });
			ans.push_back({ tmp + 1,tmp + 2 });
			ans.push_back({ tmp + 2,tmp + 3 });
			loc = tmp + 3;
			tmp += 4;
		}
		ans.push_back({ loc,n + 1 });
		ans.push_back({ n + 1,n + 2 });
		ans.push_back({ n + 2,n + 3 });
		tmp = 4; loc = 3;
		while (tmp < n) {
			if (tmp == r1 || tmp == r2) {
				tmp += 4; continue;
			}
			ans.push_back({ n+loc,n+tmp });
			ans.push_back({ n+tmp,n+tmp + 1 });
			ans.push_back({ n+tmp + 1,n+tmp + 2 });
			ans.push_back({ n+tmp + 2,n+tmp + 3 });
			loc = tmp + 3;
			tmp += 4;
		}
		cout << "Yes" << endl;
		//cout << ans.size() << endl;
		rep(i, 2 * n - 1) {
			cout << ans[i].first << " " << ans[i].second << endl;
		}
	}
	else if (n % 4 == 1) {
		ans.push_back({ 1,2 });
		ans.push_back({ 2,3 });
		int tmp = 4; int loc = 3;
		while (tmp < n-1) {
			ans.push_back({ loc,tmp });
			ans.push_back({ tmp,tmp+1 });
			ans.push_back({ tmp+1,tmp+2 });
			ans.push_back({ tmp+2,tmp+3 });
			loc = tmp + 3; tmp += 4;
		}
		ans.push_back({ loc,n + 1 });
		ans.push_back({ n + 1,n + 2 });
		ans.push_back({ n + 2,n + 3 });
		tmp = 4; loc = 3;
		while (tmp < n-1) {
			ans.push_back({ n+loc,n+tmp });
			ans.push_back({ n+tmp,n+tmp + 1 });
			ans.push_back({ n+tmp + 1,n+tmp + 2 });
			ans.push_back({ n+tmp + 2,n+tmp + 3 });
			loc = tmp + 3; tmp += 4;
		}
		ans.push_back({ 1,n - 1 }); ans.push_back({ n - 1,n });
		ans.push_back({ 1,n + n }); ans.push_back({ n + n,n + n - 1 });
		cout << "Yes" << endl;
		//cout << ans.size() << endl;
		rep(i, 2 * n - 1) {
			cout << ans[i].first << " " << ans[i].second << endl;
		}
	}
	else {
		int cop = n - 2;
		while (cop % 2 == 0)cop /= 2;
		if (cop == 1) {
			ans.push_back({ 1,n - 1 });
			ans.push_back({ n-1,n - 2 });
			ans.push_back({ n-2,n + 1 });
			ans.push_back({ n+1,n+n - 1 });
			ans.push_back({ n+n-1,n +n- 2 });

			ans.push_back({ n+n-2,2 });
			ans.push_back({ 2,n });
			ans.push_back({ n+n-2,n+n });
			ans.push_back({ n+n,2+n });
			ans.push_back({ 2,3 });
			ans.push_back({ n + n - 1,3 + n });

			int tmp = 4; int loc = 1;
			while (tmp < n - 2) {
				ans.push_back({ loc,tmp });
				ans.push_back({ tmp,tmp + 1 });
				ans.push_back({ tmp + 1,tmp + 2 });
				ans.push_back({ tmp + 2,tmp + 3 });
				loc = tmp + 3;
				tmp += 4;
			}
			tmp = 4; loc = -3;
			while (tmp < n - 2) {
				ans.push_back({ n + loc,n + tmp });
				ans.push_back({ n + tmp,n + tmp + 1 });
				ans.push_back({ n + tmp + 1,n + tmp + 2 });
				ans.push_back({ n + tmp + 2,n + tmp + 3 });
				loc = tmp + 3;
				tmp += 4;
			}
			cout << "Yes" << endl;
			//cout << ans.size() << endl;
			rep(i, 2 * n - 1) {
				cout << ans[i].first << " " << ans[i].second << endl;
			}
			return;
		}
		int r1 = 0;
		rep(j, 30) {
			if ((n-2)&(1 << j)) {
				r1 = (1 << j);
				break;
			}
		}
		int r2 = r1 ^ (n-2);
		ans.push_back({ r1,r2 });
		ans.push_back({ r2,(n-2) });
		ans.push_back({ n-2,r1 + n });
		ans.push_back({ r1 + n,r2 + n });
		ans.push_back({ r2 + n,n + (n-2) });
		rep1(i, 3) {
			ans.push_back({ r1 + i - 1,r1 + i });
			ans.push_back({ r2 + i - 1,r2 + i });
		}
		ans.push_back({ r1 + n,r1 + n + 3 });
		ans.push_back({ r1 + n + 3,r1 + n + 2 });
		ans.push_back({ r1 + n + 2,r1 + n + 1 });
		ans.push_back({ r2 + n,r2 + n + 3 });
		ans.push_back({ r2 + n + 3,r2 + n + 2 });
		ans.push_back({ r2 + n + 2,r2 + n + 1 });
		int tmp = 0;
		ans.push_back({ r1,1 });
		ans.push_back({ 1,2 });
		ans.push_back({ 2,3 });
		tmp = 4; int loc = 3;
		while (tmp < n-2) {
			if (tmp == r1 || tmp == r2) {
				tmp += 4; continue;
			}
			ans.push_back({ loc,tmp });
			ans.push_back({ tmp,tmp + 1 });
			ans.push_back({ tmp + 1,tmp + 2 });
			ans.push_back({ tmp + 2,tmp + 3 });
			loc = tmp + 3;
			tmp += 4;
		}
		ans.push_back({ loc,n + 1 });
		ans.push_back({ n + 1,n + 2 });
		ans.push_back({ n + 2,n + 3 });
		tmp = 4; loc = 3;
		while (tmp < n-2) {
			if (tmp == r1 || tmp == r2) {
				tmp += 4; continue;
			}
			ans.push_back({ n + loc,n + tmp });
			ans.push_back({ n + tmp,n + tmp + 1 });
			ans.push_back({ n + tmp + 1,n + tmp + 2 });
			ans.push_back({ n + tmp + 2,n + tmp + 3 });
			loc = tmp + 3;
			tmp += 4;
		}
		ans.push_back({ 3,n - 1 });
		ans.push_back({ n-1,n });
		ans.push_back({ 3,n + n });
		ans.push_back({ n+n,n +n-1 });
		cout << "Yes" << endl;
		//cout << ans.size() << endl;
		rep(i, 2 * n - 1) {
			cout << ans[i].first << " " << ans[i].second << endl;
		}
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	//cout << fixed << setprecision(10);
	//init();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 4464