#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define all(v) v.begin(), v.end()
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#define debug(...)\
  std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;

void err () {
  std::cout << "No" << std::endl;
  exit(0);
}

template <typename T>
std::istream& operator>> (std::istream& is, std::vector<T>& v) {
  for (auto & x : v) is >> x;
  return is;
}

template <typename T>
std::ostream& operator<< (std::ostream& os, const std::vector<T>& v) {
  auto n = v.size();
  os << "{";
  for (size_t i = 0; i < n; i++)
    {os << (i > 0 ? "," : "") << v.at(i);}
  return os << "}";
}

template <typename T>
auto make_vector_impl(size_t sz, T t) {return std::vector<T>(sz, t);}

template <size_t N, typename T, typename U, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz, U u) {return make_vector_impl(sz, T(u));}

template <size_t N, typename T, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz) {return std::vector<T>(sz);}

template <size_t N, typename T, typename... Args, std::enable_if_t<N != 1, std::nullptr_t> = nullptr>
auto make_vector(size_t a, Args... args) {return make_vector_impl(a, make_vector<N - 1, T>(args...));}

template <typename T, typename Size_t>
auto& at(T& t, Size_t i) {return t.at(i);}

template <typename T, typename Size_t, typename... Args>
auto& at(T& t, Size_t i, Args... args) {return at(t.at(i), args...);}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n; std::cin >> n;
  auto is_pow = [&] (auto n) {
    auto p = 1;
    loop(30) {
      if (n == p) return true;
      p *= 2;
    }
    return false;
  };
  if (is_pow(n)) err();
  std::vector< std::pair< int, int > > edges = {
    {3, n + 1}
  };
  for (auto i = 2; i < n; i += 2) {
    edges.emplace_back(1, i);
    edges.emplace_back(i, i + 1);
    edges.emplace_back(1, n + i + 1);
    edges.emplace_back(n + i, n + i + 1);
  }
  if (n % 2 == 0) {
    auto X = 1;
    while (2 * X <= n) {
      X *= 2;
    }
    assert(X < n);
    edges.emplace_back(X, n);
    edges.emplace_back((n ^ X ^ 1) + n, 2 * n);
  }
  // debug(edges.size(), 2 * n - 1);
  std::cout << "Yes" << std::endl;
  assert((int)edges.size() == 2 * n - 1);
  for (auto e : edges) {
    std::cout << e.first << " " << e.second << std::endl;
  }

  auto N = 2 * n;
  auto graph = make_vector< 2, int >(N, 0);
  for (auto e : edges) {
    int i, j; std::tie(i, j) = e;
    i--, j--;
    graph.at(i).emplace_back(j);
    graph.at(j).emplace_back(i);
  }
  std::vector< int > prt(N, -1);
  auto root = 0;
  prt.at(root) = root;
  auto dfs = [&](auto&& f, auto crr) -> void {
    for (auto nxt : graph.at(crr)) {
      if (nxt == prt.at(crr)) continue;
      assert(prt.at(nxt) == -1);
      prt.at(nxt) = crr;
      f(f, nxt);
    }
  };
  dfs(dfs, root);
  auto efs = [&](auto&& f, auto s, auto crr, auto val) -> void {
    if (crr == s + n)
      { assert(val == s + 1); }
    for (auto nxt : graph.at(crr)) {
      if (nxt == prt.at(crr)) continue;
      f(f, s, nxt, val ^ (nxt < n ? (nxt + 1) : (nxt - n + 1)));
    }
  };
  rep(i, 0, n) {
    efs(efs, i, i, i + 1);
  }
  return 0;
}


Measured memory_bytes: 15984