#include <bits/stdc++.h>
using namespace std;
typedef long long   signed int LL;
typedef long long unsigned int LU;
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
template<typename T> bool setmin  (T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmax  (T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
LL mo(LL a, LL b) { assert(b > 0); a %= b; if(a < 0) { a += b; } return a; }
LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }
#define bit(b, i) (((b) >> (i)) & 1)
#define BC __builtin_popcountll
#define SC(T, v) static_cast<T>(v)
#define SI(v) SC(int, v.size())
#define SL(v) SC( LL, v.size())
#define RF(e, v) for(auto & e: v)
#define ei else if
#define UR assert(false)

// ---- ----

int n, a, b;

string to_bin(int x) {
	string s;
	inc(i, n) {
		s += '0' + x % 2;
		x /= 2;
	}
	reverse(ALL(s));
	return s;
}

int main() {
	cin >> n >> a >> b;
	
	int d = BC(a ^ b);
	
	if(d % 2 == 0) { cout << "NO" << endl; return 0; }
	cout << "YES" << endl;
	
	vector<vector<int>> C(n + 1), L(n + 1);
	C[0] = { 0 };
	L[1] = { 0, 1 };
	
	inc1(i, n) {
		int x = SI(C[i - 1]);
		inc(j, x) { C[i].PB(C[i - 1][j] | (0 * x)); }
		dec(j, x) { C[i].PB(C[i - 1][j] | (1 * x)); }
	}
	
	incII(i, 3, n) {
		if(i % 2 == 0) { continue; }
		
		int x = SI(L[i - 2]);
		incID(j, 0, 1) { L[i].PB(L[i - 2][j] | (0 * x)); }
		incID(j, 0, x) { L[i].PB(C[i - 2][j] | (2 * x)); }
		incID(j, 1, x) { L[i].PB(L[i - 2][j] | (0 * x)); }
		decID(j, 0, x) { L[i].PB(L[i - 2][j] | (1 * x)); }
		incID(j, 0, x) { L[i].PB(L[i - 2][j] | (3 * x)); }
	}
	
	int s = n - d;
	
	// cout << "d, s: " << d  << ", " << s << endl;
	
	/*
	inc(i, n + 1) {
		cout << "C: "; RF(e, C[i]) { cout << e << " "; } cout << endl;
		cout << "L: "; RF(e, L[i]) { cout << e << " "; } cout << endl;
	}
	
	inc(i, n + 1) {
		inc(j, SI(C[i]) - 1) { cout << BC(C[i][j] ^ C[i][j + 1]) << " "; } cout << endl;
		inc(j, SI(L[i]) - 1) { cout << BC(L[i][j] ^ L[i][j + 1]) << " "; } cout << endl;
	}
	*/
	
	vector<int> v;
	inc(i, 1 << d) {
		if(i % 2 == 0) { inc(j, 1 << s) { v.PB((L[d][i] << s) | C[s][j]); } }
		if(i % 2 == 1) { dec(j, 1 << s) { v.PB((L[d][i] << s) | C[s][j]); } }
	}
	
	// cout << "v: "; inc(i, SI(v)) { cout << v[i] << " "; } cout << endl;
	
	// incID(i, 1, 1 << d) { cout << BC(v[i] ^ v[i - 1]) << " "; } cout << endl;
	
	incID(i, 1, 1 << d) { assert(BC(v[i] ^ v[i - 1]) == 1); }
	
	vector<int> ans;
	inc(i, 1 << n) {
		if(i == 0) { ans.PB(a); }
		else {
			int p = -1, c = 0;
			inc(j, n) { if(bit(v[i] ^ v[i - 1], j)) { p = j; c++; } }
			assert(c == 1);
			assert(p >= 0);
			
			int pp = -1;
			c = 0;
			if(p < s) {
				inc(j, n) { if(bit(a ^ b, j) == 0) { if(c == p) { pp = j; } c++; } }
			} else {
				p -= s;
				inc(j, n) { if(bit(a ^ b, j) == 1) { if(c == p) { pp = j; } c++; } }
			}
			assert(pp >= 0);
			
			int z = ans.back();
			ans.PB(z ^ (1 << pp));
		}
	}
	
	inc(i, SI(ans)) { cout << (i == 0 ? "" : " ") << ans[i]; }
	cout << endl;
	
	
	return 0;
}


Measured memory_bytes: 4280