#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const int INF=1<<30;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;typedef vector<ll> vll;typedef pair<int,int> pii;typedef vector<int> vi;typedef vector<vi> vvi;
#ifdef ONLINE_JUDGE
#define assert(...) /* nothing */
#endif
#define DEBUG_CAT
#ifdef DEBUG_CAT
#define dbg(...)   printf( __VA_ARGS__ )
#else 
#define dbg(...)   /****nothing****/
#endif
int rint();char rch();long long rlong();
// mt19937 rng; rng.seed(std::chrono::high_resolution_clock::now().time_since_epoch().count());
// template<typename T> int bins(vector<T> &v, T key) {int imin=0,imax=v.size();while(imin<imax) {int imid=(imin+imax)>>1;if (v[imid]<key) imin=imid+1;else imax=imid;}return imin;}

void fail() {
	printf("No\n"); exit(0);
}

int main() 
{
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n; cin>>n;
  int want=0; for (int x=1;x<=n;x++) want^=x;
  if (want==0) {
  	printf("Yes\n");
  	for (int x=1;x<2*n;x++) printf("%d %d\n",x,x+1);
  	exit(0);
  }
  set<vi> sv;
  for (int a=1;a<=n;a++) {
  	if (a==want) continue;
  	int b=want^a;
  	if (1<=b&&b<=n&&b!=want&&b!=a) {
  		vi v; v.PB(min(a,b)); v.PB(max(a,b));
  		sv.insert(v);
  	}
  }
  if (want<=n) {
  	vi v; v.PB(want); sv.insert(v);
  }
  for (auto &wa:sv) {
  	for (auto &wb:sv) {
  		set<int> s;
  		for (auto &x:wa) s.insert(x);
  		for (auto &x:wb) s.insert(x);
  		if (s.size()==wa.size()+wb.size()) {
  			vi v;
  			for (int k=0;k<2;k++) {
	  			for (auto &x:wa) v.PB(x+k*n);
	  			for (int x=1;x<=n;x++) {
	  				if (s.count(x)==0) v.PB(x+k*n);
	  			}
	  		}
	  		printf("Yes\n");
	  		for (int i=1;i<v.size();i++)printf("%d %d\n",v[i-1],v[i]);
	  		for (int k=0;k<2;k++) {
	  			for (int i=1;i<wb.size();i++) printf("%d %d\n",wb[i-1]+k*n,wb[i]+k*n);
	  		}
	  		printf("%d %d\n",wb.back(),wa.front());
	  		printf("%d %d\n",wa.back(),wb.front()+n);
	  		exit(0);
  		}
  	}
  }
	fail();
}




static char stdinBuffer[1024];
static char* stdinDataEnd = stdinBuffer + sizeof (stdinBuffer);
static const char* stdinPos = stdinDataEnd;

void readAhead(size_t amount)
{
    size_t remaining = stdinDataEnd - stdinPos;
    if (remaining < amount) {
       memmove(stdinBuffer, stdinPos, remaining);
       size_t sz = fread(stdinBuffer + remaining, 1, sizeof (stdinBuffer) - remaining, stdin);
       stdinPos = stdinBuffer;
       stdinDataEnd = stdinBuffer + remaining + sz;
       if (stdinDataEnd != stdinBuffer + sizeof (stdinBuffer))
         *stdinDataEnd = 0;
    }
}

int rint()
{
    readAhead(16);

    int x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}
char rch()
{
    readAhead(16);
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    char ans=*stdinPos;
    ++stdinPos;
    return ans;
}
long long rlong()
{
    readAhead(32);

    long long x = 0;
    bool neg = false;
    while(*stdinPos==' '||*stdinPos=='\n') ++stdinPos;
    if (*stdinPos == '-') {
       ++stdinPos;
       neg = true;
    }

    while (*stdinPos >= '0' && *stdinPos <= '9') {
       x *= 10;
       x += *stdinPos - '0';
       ++stdinPos;
    }

    return neg ? -x : x;
}

Measured memory_bytes: 8440