#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;
const ld pi = acos(-1.0);

struct graph {
private:
	int n;
	vector<vector<int>> G, rG;
	vector<bool> used;
	vector<int> vs;

	int mk;
	vector<vector<int>> fG;
	vector<vector<int>> ori;
	vector<int> trans;
public:
	graph(int sz) {
		n = sz;
		G.resize(n);
		rG.resize(n);
		used.resize(n);

		fG.resize(n);
		trans.resize(n, -1);
		ori.resize(n);
	}
	void add_edge(int a, int b) {
		G[a].push_back(b);
		rG[b].push_back(a);
	}
	void dfs(int v) {
		used[v] = true;
		rep(i, G[v].size()) {
			if (!used[G[v][i]])dfs(G[v][i]);
		}
		vs.push_back(v);
	}
	void rdfs(int v, int k) {
		used[v] = true;
		queue<int> q; q.push(v);
		vector<int> c;
		while (!q.empty()) {
			int id = q.front(); q.pop();
			ori[k].push_back(id);
			rep(j, rG[id].size()) {
				int to = rG[id][j];
				if (used[to]) {
					if (trans[to] >= 0)c.push_back(trans[to]);
					continue;
				}
				used[to] = true; q.push(to);
			}
		}
		sort(c.begin(), c.end());
		int len = unique(c.begin(), c.end()) - c.begin();
		rep(i, len) {
			fG[c[i]].push_back(k);
		}
		rep(i, ori[k].size()) {
			trans[ori[k][i]] = k;
		}
	}
	void scc() {
		fill(used.begin(), used.end(), false);
		rep(i, n) {
			if (!used[i])dfs(i);
		}
		fill(used.begin(), used.end(), false);
		int k = 0;
		per(i, (int)vs.size()) {
			if (!used[vs[i]]) {
				rdfs(vs[i], k); k++;
			}
		}
		mk = k;
	}
	vector<int> query(int x) {
		vector<int> ret;
		vector<bool> ban(mk, false);
		rep(i, mk) {
			rep(j, ori[i].size()) {
				int t = ori[i][j];
				if (trans[t^x] == i)ban[i] = true;
			}
		}
		per(i, mk) {
			if (ban[i])continue;
			//cout << i << endl;
			rep(j, ori[i].size()) {
				int cur = ori[i][j];
				ret.push_back(cur);
				int iid = trans[cur^x];
				ban[iid] = true;
			}
		}
		return ret;
	}
};

void solve() {
	int n, x, a, o;
	cin >> n >> x >> a >> o;
	if (x == 0) {
		cout << "No" << endl; return;
	}
	int sup = 1 << (n + 1);
	graph g(sup);
	rep(i, sup) {
		if ((a&i) == a) {
			vector<int> v;
			rep(j, n + 1) {
				if ((i&(1 << j)) == 0) {
					v.push_back(j);
				}
			}
			int len = v.size();
			rep(j, 1 << len) {
				int ss = 0;
				rep(k, len) {
					if (j&(1 << k)) {
						ss += 1<<v[k];
					}
				}
				ss += a;
				//cout << i << " " << ss << endl;
				g.add_edge(i, ss^x);
				g.add_edge(ss, i^x);
			}
		}
	}
	rep(i, sup) {
		int aa = 0;
		vector<int> v;
		bool pass = false;
		rep(j, n + 1) {
			if (o&(1 << j)) {
				if (i&(1 << j)) {
					v.push_back(j);
				}
				else {
					aa += 1 << j;
				}
			}
			else {
				if (i&(1 << j)) {
					pass = true;
				}
			}
		}
		if (pass)continue;
		int len = v.size();
		rep(j, 1 << len) {
			int ss = 0;
			rep(k, len) {
				if (j&(1 << k)) {
					ss += 1 << v[k];
				}
			}
			ss += aa;
			//cout << i << " " << ss << endl;
			g.add_edge(i, ss^x);
			g.add_edge(ss, i^x);
		}
	}
	g.scc();
	vector<int> ans = g.query(x);
	//cout << ans.size() << endl;
	if (ans.size() >= (1 << n)) {
		cout << "Yes" << endl;
		rep(i, (1 << n)) {
			if (i > 0)cout << " ";
			cout << ans[i];
		}
		cout << endl;
	}
	else {
		cout << "No" << endl;
	}

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(50);
	//init();
	solve();

	//cout << "finish" << endl;
	//stop
	return 0;
}


Measured memory_bytes: 257472