#if 0
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto & in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N,M;
std::set<int> edge[100000];

void dfs(int v)
{
	bool step  = false;
	while (edge[v].size() % 2 != 0)
	{
		int next = *--edge[v].end();
		edge[v].erase(--edge[v].end());
		edge[next].erase(v);
		if (step) {
			out << v << " " << next << '\n';
		}
		else {
			out << next << " " << v << '\n';
		}
		step = !step;
		v = next;
	}
}

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N>>M;
	for (int i = 0; i < M; i++)
	{
		int a, b;
		in >> a >> b; --a; --b;
		edge[a].insert(b);
		edge[b].insert(a);
	}

	if (M % 2 != 0) {
		out << "-1\n";
		return 0;
	}

	for (int i = 0; i < N; i++) {
		dfs(i);
	}
	for (int i = 0; i < N; i++) {
		while (!edge[i].empty()) {
			int next = *--edge[i].end();
			edge[i].erase(--edge[i].end());
			edge[next].erase(i);
			out << next << " " << i << '\n';

			next = *--edge[i].end();
			edge[i].erase(--edge[i].end());
			edge[next].erase(i);
			out << next << " " << i << '\n';
		}
	}

	return 0;
}
#endif

#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto & in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
std::vector<int> edge[210000];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	if (N <= 2) {
		out << "No" << endl;
		return 0;
	}
	int mask = 0;
	while (mask <= N) {
		mask = (mask << 1) | 1;
	}
	mask >>= 1;
	if (mask+1 == N) {
		out << "No" << endl;
		return 0;
	}
	out << "Yes" << endl;

	for (int i = 1; i < mask; i++)
	{
		edge[i].push_back(i + 1);
		edge[i + 1].push_back(i);
	}
	edge[1].push_back(N + mask);
	edge[N + mask].push_back(1);
	for (int i = N + mask - 1; i > N; --i)
	{
		edge[i].push_back(i + 1);
		edge[i + 1].push_back(i);
	}

	for (int i = mask+1; i+1 <= N; i+=2)
	{
		edge[i].push_back(1);
		edge[1].push_back(i);

		edge[i].push_back(i + 1);
		edge[i + 1].push_back(i);


		edge[1].push_back(N + i + 1);
		edge[N + i + 1].push_back(1);

		edge[N + i].push_back(N + i + 1);
		edge[N + i + 1].push_back(N + i);
	}
	if (N%2 == 0) {
		edge[N].push_back(N + N - 1);
		edge[N + N - 1].push_back(N);

		int nextbit = N - 1;
		int bitbit = 0;
		while ((nextbit & (1 << bitbit)) != 0) { ++bitbit; }
		nextbit = nextbit - ((nextbit >> bitbit) << bitbit);
		nextbit = (nextbit << 1) | 1;

		edge[N + N].push_back(nextbit-1);
		edge[nextbit-1].push_back(N + N);
	}

	for (int i = 1; i <= 2*N; i++)
	{
		for (auto& e : edge[i]) {
			if (e < i) {
				out << e << " " << i << '\n';
			}
		}
	}
	out << std::flush;

	return 0;
}
#endif


Measured memory_bytes: 13948