#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
long long mod = 2;
vector<long long> kake(vector<long long> a, vector<long long> b) {
	vector<long long> ans;
	int size_a = sqrt(a.size());
	REP(i, size_a) {
		REP(q, size_a) {
			long long tmp = 0;
			REP(j, size_a) {
				tmp += a[i * size_a + j] * a[j * size_a + q];
				tmp %= mod;
			}
			ans.push_back(tmp);
		}
	}
	return ans;
}
#define int long long
void swa(long long& a, int i, int j) {
	if ((a & (1 << i)) && !(a & (1 << j))) a += -(1 << i) + (1 << j);
	else if (!(a & (1 << i)) && (a & (1 << j))) a += (1 << i) - (1 << j);
}
vector<long long> solve(int n, int a, int b) {
	if (n == 1) return { a,b };
	int change = n - 1;
	int c = a ^ b;
	if ((c & (1 << (n - 1))) == 0) {
		for (int d = 0; d < n-1; ++d) {
			if (c & (1 << d)) {
				change = d;
				break;
			}
		}
	}
	swa(a, n - 1, change);
	swa(b, n - 1, change);
	int na = a & ~(1 << (n - 1));
	vector<long long> zenhan = solve(n - 1, na, na ^ 1);
	int nb = b & ~(1 << (n - 1));
	vector<long long> kouhan = solve(n - 1, na ^ 1, nb);
	vector<long long> ans;
	if ((a & (1 << (n - 1))) != 0) {
		REP(i, zenhan.size()) {
			ans.push_back(zenhan[i] ^ (1 << (n - 1)));
		}
		REP(i, kouhan.size()) {
			ans.push_back(kouhan[i]);
		}
	}
	else {
		REP(i, zenhan.size()) {
			ans.push_back(zenhan[i]);
		}
		REP(i, kouhan.size()) {
			ans.push_back(kouhan[i] ^ (1 << (n-1)));
		}
	}
	REP(i, ans.size()) {
		swa(ans[i], n - 1, change);
	}
	return ans;
}
#undef int
int main() {
	long long n, a, b;
	cin >> n >> a >> b;
	long long c = a ^ b;
	int cnt = 0;
	REP(i, n) {
		if (c & (1 << i))cnt++;
	}
	if (cnt % 2 == 0) {
		cout << "NO" << endl;
		return 0;
	}
	vector<long long> res = solve(n, a, b);
	cout << "YES" << endl;
	REP(i, res.size()) {
		cout << res[i] << " ";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 2408