// vvvvvvvvvvvv TEMPLATE vvvvvvvvvvvv
#include <bits/stdc++.h>
using namespace std; using ll = long long; using P = pair<ll, ll>;
const ll linf = 1e18; const double eps = 1e-12, pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define each(i,a) for (auto&& i : a)
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
template<typename T> ll min(ll a, const T&& b) { return a < b ? a : b; }
template<typename T> ll min(const T&& a, ll b) { return a < b ? a : b; }
template<typename T> ll max(ll a, const T&& b) { return a > b ? a : b; }
template<typename T> ll max(const T&& a, ll b) { return a > b ? a : b; }
template<typename Head> void out(Head h) { cout << h << endl; } template<typename Head, typename... Tail>void out(Head h, Tail... t) { cout << h << " "; out(t...); }
template<typename T> istream& operator>>(istream& is, vector<T>& v) { each(x,v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
ostream& operator<<(ostream& os, const vector<string>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T1, typename T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) { return os << "(" << p.first << ", " << p.second << ")"; }
struct yes_no : std::numpunct<char> { string_type do_truename() const { return "Yes"; } string_type do_falsename() const { return "No"; } };
void solve(); int main() {
  ios::sync_with_stdio(false); cin.tie(0); locale loc(locale(), new yes_no); cout.imbue(loc); cout << fixed << setprecision(10) << boolalpha;
  solve();
}
// ^^^^^^^^^^^^ TEMPLATE ^^^^^^^^^^^^

vector<P> make_graph(const ll n, const vector<P>& v) {
  vector<P> res;
  // make: 0(1), v[0].first, v[0].second, 0(n), v[0].first, v[0].second
  res.eb(1, v[0].first);
  res.eb(v[0].first, v[0].second);
  res.eb(v[0].second, n+1);
  res.eb(n+1, n+v[0].first);
  res.eb(n+v[0].first, n+v[0].second);
  // make: v[i].first, v[i].second, 0(1), ..., 0(n), v[i].first, v[i].second
  rep(i, 1, v.size()) {
    res.eb(v[i].first, v[i].second);
    res.eb(v[i].second, 1);
    res.eb(n+1, n+v[i].first);
    res.eb(n+v[i].first, n+v[i].second);
  }
  return res;
}

void solve() {
  ll n; cin >> n;
  if (n < 3) {
    cout << false << endl;
    return;
  }
  if (__builtin_popcountll(n) == 1) {
    cout << false << endl;
    return;
  }
  vector<P> ans;
  if (n == 6) {
    cout << "Yes" << endl;

    cout << 1 << " " << 3 << endl;
    cout << 3 << " " << 2 << endl;
    cout << 2 << " " << n+1 << endl;
    cout << n+1 << " " << n+3 << endl;
    cout << n+3 << " " << n+2 << endl;
    cout << n+2 << " " << 6 << endl;
    cout << n+2 << " " << 4 << endl;
    cout << 4 << " " << 5 << endl;
    cout << n+6 << " " << 4 << endl;
    cout << n+3 << " " << n+5 << endl;
    cout << n+5 << " " << n+4 << endl;
    return;
  }
  vector<P> v;
  for (ll i = 2; i+1 <= n; i += 2) v.eb(i, i+1);
  if (n % 2 == 1) {
    ans = make_graph(n, v);
  }
  else {
    ll x = n & -n, y = n ^ x;
    vector<P> nv;
    P xp, yp;
    each(p, v) {
      if (p.first == x || p.second == x) {
        xp = p;
      }
      else if (p.first == y || p.second == y) {
        yp = p;
      }
      else {
        nv.pb(p);
      }
    }
    assert(xp.first != xp.second);
    assert(yp.first != yp.second);
    if (xp.first == x) {
      swap(xp.first, xp.second);
    }
    if (yp.first != y) {
      swap(yp.first, yp.second);
    }
    v = nv;
    // cout << xp << endl;
    // cout << yp << endl;
    ans = make_graph(n, v);

    ans.eb(1, xp.first);
    ans.eb(xp.first, xp.second);
    ans.eb(xp.second, yp.first);
    ans.eb(yp.first, yp.second);
    ans.eb(yp.second, n+xp.first);
    ans.eb(n+xp.first, n+xp.second);
    ans.eb(n+xp.second, n+yp.first);
    ans.eb(n+yp.first, n+yp.second);

    ans.eb(x, n);
    ans.eb(y, n+n);
  }
  cout << "Yes" << endl;
  each(p, ans) {
    cout << p.first << " " << p.second << endl;
  }
}


Measured memory_bytes: 7780