#include <bits/stdc++.h>

const int N = 5e5 + 50;

int n;

int main()
{
	scanf("%d", &n);
	if (n & n - 1)
	{
		printf("Yes\n1 2\n2 3\n3 %d\n%d %d\n%d %d\n", n + 1, n + 1, n + 2, n + 2, n + 3);
		for (int k = 4; k < n; k += 2) printf("%d %d\n%d %d\n%d %d\n%d %d\n", n + 1, k, n + 1, k + 1, k, k + n + 1, k + n, k + 1);
		if ((n & 1) == 0)
		{
			int c = n + 1, j = 2;
			std::function<bool(int)> valid = [&](int u) { return 2 <= u && u <= n; };
			while (!valid(c ^ j)) ++j;
			assert(j <= n);
			if (j == 2) printf("%d %d\n%d %d\n", j + n, n, c ^ j, n << 1);
			else printf("%d %d\n%d %d\n", j, n, c ^ j, n << 1);
		}
	}
	else puts("No");
}

