#include <bits/stdc++.h>
#define sz(c)      int(c.size())
#define rep(i,a,b) for (int i=a; i<(b); ++i)
#define per(i,a,b) for (int i=(b)-1; i>=(a); --i)
#define bin(x)     (bitset<3>(x))
using namespace std;
using ll = long long;

int swap_bits(int x,int i,int j) {
	int bit_i=x>>i&1;
	int bit_j=x>>j&1;
	return x^(bit_i<<i)^(bit_j<<j)^(bit_i<<j)^(bit_j<<i);
}

vector<int> solve(int n,int a,int b) {
	if (__builtin_parity(a)==__builtin_parity(b)) return {};

	if (n==1) return {a,b};

	int bit=1<<(n-1);
	if ((bit&a)!=(bit&b)) {
		auto p=solve(n-1,a,a^1);
		auto q=solve(n-1,a^1^bit,b);
		p.insert(p.end(),q.begin(),q.end());
		return p;
	} else {
		auto p=solve(n-1,a,b);
		auto q=solve(n-1,a^bit,p[1]^bit);
		p.insert(p.begin()+1,q.begin(),q.end());
		return p;
	}
}

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cout<<fixed<<setprecision(10);

	int N,A,B;
	cin>>N>>A>>B;
	auto res=solve(N,A,B);
	if (res.empty()) {
		cout<<"NO\n";
	} else {
		cout<<"YES\n";
		for (int x:res) cout<<x<<" ";
		cout<<"\n";
	}
}
