#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;

int n, a, b;
int popcnt(int x) {
	int r = 0;
	for (int i = 0; i < 17; i++)
		r += (x >> i) & 1;
	return r;
}
bool recv(int x) {
	if (x == 1)
		return true;
	return recv(x / 2) & (x & 1);
}
vector<int> r;
void rec(int d, int f) {
	if (f == 0)
		return;
	int x = d & -d;
	d ^= x, f ^= x;

	if (!d) {
		rec(f & -f, f);
		r.emplace_back(x);
		rec(f & -f, f);
	}
	else {
		int cnt = popcnt(d);
		int y = d & -d;
		int z = d ^ y;

		rec(y, f);
		r.emplace_back(x);
		rec(z, f);
	}
}
int main() {
	scanf("%d %d %d", &n, &a, &b);
	bool valid = popcnt(a ^ b) & 1;
	printf(valid ? "YES\n" : "NO\n");
	if (!valid)
		return 0;
	rec(a ^ b, (1 << n) - 1);

	printf("%d", a);
	for (int i = 0; i < r.size(); i++)
		printf(" %d", a ^= r[i]);
	printf("\n");
}