#include <bits/stdc++.h>

#define itn int
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())

#define random_shuffle(...) shuffle(__VA_ARGS__, rng)
#define rand() rng()

using namespace std;

inline int nxt() {
	int x;
	scanf("%d", &x);
	return x;
}

vector<int> solve(int n, int a, int b) {
	if (n == 1) {
		return {a, b};
	}
	assert(__builtin_parity(a) != __builtin_parity(b));
	int bit = 1 << (n - 1);
	if ((a & bit) != (b & bit)) {
		auto res1 = solve(n - 1, a, a ^ 1);
		auto res2 = solve(n - 1, (a ^ 1) ^ bit, b);
		res1.insert(res1.end(), all(res2));
		return res1;
	} else {
		auto res1 = solve(n - 1, a, b);
		auto res2 = solve(n - 1, a ^ bit, res1[1] ^ bit);
		res1.insert(res1.begin() + 1, all(res2));
		return res1;
	}
}

int main() {
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

	int n = nxt(), a = nxt(), b = nxt();
	if (__builtin_parity(a) == __builtin_parity(b)) {
		cout << "NO\n";
		return 0;
	}

	printf("YES\n");
	auto res = solve(n, a, b);
	for (int x : res) {
		printf("%d ", x);
	}
	printf("\n");

	return 0;
}