#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

int N, A, B;
int a[17], b[17];
int used[17];
pair<int, int> P[8];
void match(int n) {
	rep(j, N) if (used[j] == 0) {
		if (n != (N + 1) / 2 - 1) {
			for (int i = j + 1; i < N; i++) {
				if (used[i] == 0) {
					if ((a[j] + b[j] + a[i] + b[i]) % 2 == 0) {
						used[j] = 1;
						used[i] = 1;
						P[n] = mp(j, i);
						match(n + 1);
						break;
					}
				}
			}
		}
		else {
			for (int i = j + 1; i < N; i++) {
				if (used[i] == 0) {
					P[n] = mp(j, i);
					break;
				}
			}
		}
	}
}

void putint(int X) {
	if (X == 0) putchar('0');
	int keta = 0;
	char C[10];
	while (X) {
		C[keta] = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--) putchar(C[i]);
	putchar(' ');
}

int main() {


	cin >> N >> A >> B;

	if (N == 1) {
		co("YES");
		cosp(A);
		co(B);
	}
	else {
		int na = 0;
		int nb = 0;
		rep(i, N) if (A >> i & 1) {
			a[i] = 1;
			na ^= 1;
		}
		rep(i, N) if (B >> i & 1) {
			b[i] = 1;
			nb ^= 1;
		}

		if (na == nb) {
			co("NO");
		}
		else {
			putchar('Y');
			putchar('E');
			putchar('S');
			putchar('\n');
			match(0);

			int kotae = A;
			int dotti[8] = {};
			rep(i, N / 2) {
				if (a[P[i].first] == b[P[i].first]) dotti[i] = 1;
			}

			int hajimete[8] = {};
			int dotti2[8] = {};
			rep(k, N % 2 + 1) {
				rep1(i, (1 << N / 2 * 2) - 1) {
					putint(kotae);
					int keta = 0;
					int kari = i;
					while (kari % 4 == 0) {
						kari /= 4;
						keta++;
					}
					if (keta == (N + 1) / 2 - 1) {
						if (kari % 2 == 0) {
							if (dotti[keta]) kotae ^= 1 << P[keta].second;
							else kotae ^= 1 << P[keta].first;
						}
						else {
							if (dotti[keta]) kotae ^= 1 << P[keta].first;
							else kotae ^= 1 << P[keta].second;
						}
					}
					else {
						if (dotti2[keta] == 0) {
							if (kari % 4 == 1) {
								kotae ^= 1 << P[keta].first;
							}
							else if (kari % 4 == 2) {
								kotae ^= 1 << P[keta].second;
							}
							else {
								kotae ^= 1 << P[keta].first;
								dotti2[keta] = 1;
							}
						}
						else {
							if (kari % 4 == 1) {
								if (dotti[keta] == 0 && hajimete[keta] == 0) kotae ^= 1 << P[keta].second;
								else kotae ^= 1 << P[keta].first;
							}
							else if (kari % 4 == 2) {
								if (dotti[keta] == 0 && hajimete[keta] == 0) kotae ^= 1 << P[keta].first;
								else kotae ^= 1 << P[keta].second;
							}
							else {
								if (dotti[keta] == 0 && hajimete[keta] == 0) kotae ^= 1 << P[keta].second;
								else kotae ^= 1 << P[keta].first;
								dotti2[keta] = 0;
								hajimete[keta] = 1;
							}
						}
					}
				}
				if (k == 1 || N % 2 == 0) {
					putint(kotae);
				}
				else {
					putint(kotae);
					rep(i, N) if (used[i] == 0) kotae ^= 1 << i;
				}
			}
		}
	}

	Would you please return 0;
}


Measured memory_bytes: 1024