#include <bits/stdc++.h>

using ll = long long;
using namespace std;

#define int ll

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define YES(f) if((f)){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(f) if((f)){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define MINV(v) min_element(all(v))
#define MAXV(v) max_element(all(v))
#define MIN3(a, b, c) min(min(a, b), c)
#define MIN4(a, b, c, d) min(MIN3(a, b, c), d)
#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e)
#define MIN6(a, b, c, d, e, f) min(MIN5(a, b, c, d, e), f)
#define MAX3(a, b, c) max(max(a, b), c)
#define MAX4(a, b, c, d) max(MAX3(a, b, c), d)
#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e)
#define MAX6(a, b, c, d, e, f) max(MAX5(a, b, c, d, e), f)
#define RANGE(a, b, c) ((a) <= (b) && (b) < (c))
#define RANGE2D(a, b, c, d, e, f) (RANGE((a), (c), (e)) && RANGE((b), (d), (f)))
#define chmin(a, b) a = min(a, (b))
#define chmin3(a, b, c) a = MIN3(a, (b), (c))
#define chmin4(a, b, c, d) a = MIN4(a, (b), (c), (d))
#define chmin5(a, b, c, d, e) a = MIN5(a, (b), (c), (d), (e))
#define chmin6(a, b, c, d, e, f) a = MIN6(a, (b), (c), (d), (e), (f))
#define chmax(a, b) a = max(a, (b))
#define chmax3(a, b, c) a = MAX3(a, (b), (c))
#define chmax4(a, b, c, d) a = MAX4(a, (b), (c), (d))
#define chmax5(a, b, c, d, e) a = MAX5(a, (b), (c), (d), (e))
#define chmax6(a, b, c, d, e, f) a = MAX6(a, (b), (c), (d), (e), (f))
#define fcout cout << fixed << setprecision(12)

#define RS resize
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);

#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);
#define MOD 1000000007

template<class T>
inline T GET() {
	T x;
	cin >> x;
	return x;
}


void init();
void solve();

signed main()
{
	init();
	solve();
}

int N, A, B, bit;

bool calc()
{
	bit = 1;
	int x = 1;
	int a = A;
	int b = B;
	int c = 0;
	while (a + b) {
		if ((a ^ b) & 1) {
			bit = x;
			c++;
		}
		x <<= 1;
		a >>= 1;
		b >>= 1;
	}
	return c % 2;
}

vector<int> res(3000000);

void dfs(set<int>& s, int b, int l, int r)
{
	if (r - l == 4) {
		if (s.size() < 2) exit(1);
		int t = *s.begin();
		int u = *(next(s.begin(), 1));
		int x = t ^ res[l];
		if (x != (x & -x)) {
			swap(t, u);
		}
		res[l+1] = t;
		res[l+2] = u;
		return;
	}
	set<int> x, y;
	int t = res[l] ^ res[r-1];
	t = t & -t;
	for (auto a : s) {
		if ((a & t) ^ (t & res[r-1])) {
			x.insert(a);
		} else {
			y.insert(a);
		}
	}
	int t2 = *x.begin();
	int t3 = t2 ^ t;
	res[(r+l)/2-1] = t2;
	res[(r+l)/2] = t3;
	x.erase(t2);
	y.erase(t3);
	dfs(x, b+1, l, (r+l)/2);
	dfs(y, b+1, (r+l)/2, r);
}

int cm(int a, int b) {
	bit = 1;
	int x = 1;
	int c = 0;
	while (a + b) {
		if ((a ^ b) & 1) {
			bit = x;
			c++;
		}
		x <<= 1;
		a >>= 1;
		b >>= 1;
	}
	return c == 1;
}

void init()
{
	cin >> N >> A >> B;
	if (!calc()) {
		YES(0);
		return;
	}
	if (N == 1) {
		if (A == 1) {
			cout << "YES" << endl;
			cout << "1 0" << endl;
		} else {
			cout << "YES" << endl;
			cout << "0 1" << endl;
		}
		return;
	}
	set<int> s;
	rep(i, 1 << N) s.insert(i);
	res[0] = 0;
	res[(1<<N)-1] = A ^ B;
	s.erase(0);
	s.erase(A ^ B);
	dfs(s, 0, 0, 1<<N);
	YES(1);
	rep(i, (1<<N) - 1) cout << (res[i] ^ A) << " ";
	cout << (res[(1<<N)-1] ^ A) << endl;
	rep(i, (1<<N) - 1) {
		if (!cm(res[i], res[i+1])) {
			cout << i << endl;
		}
	}
}

void solve()
{
}




Measured memory_bytes: 42880