#include <bits/stdc++.h>
#include <sys/types.h>
#include <unistd.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}



const int limit = 16384;

// Description: 2-SAT
// Verifyed: Many Diffrent Problem
// Required: 有向グラフに対する強連結成分

using edge = struct {int to;};
using G = vector<vector<edge>>;

void add_edge(G &graph, int from, int to) {
	graph[from].push_back({to});
}

// x&1 == 1 True
// x&1 == 0 False
void closure_or(G &graph, int a, int b) {
	add_edge(graph, a ^ 1, b);
	add_edge(graph, b ^ 1, a);
}

auto strongly_connected_components(const G& graph) {
	const int n = graph.size();

	vector<int> used(n, 0), order, scc(n, 0);

	auto dfs = [&](int v) {
		auto func = [&](int v, auto func)->void{
			used[v] = true;
			for (auto &e : graph[v]) if (!used[e.to]) func(e.to, func);
			order.push_back(v);
		};
		return func(v, func);
	};

	rep(v, n) if (used[v] == false) dfs(v);

	G rgraph(n);
	rep(v, n) for (auto &e : graph[v]) add_edge(rgraph, e.to, v);
	int total = 0;

	auto rdfs = [&](int v) {
		auto func = [&](int v, auto func)->void{
			used[v] = true, scc[v] = total;
			for (auto &e : rgraph[v]) if (!used[e.to]) func(e.to, func);
		};
		return func(v, func);
	};

	used.assign(2 * n, false);
	reverse(begin(order), end(order));

	for (auto &v : order) if (used[v] == false) rdfs(v), total++;
	return scc;
}

vector<int> get_variable(G &graph) {
	const int n = graph.size() / 2;
	vector<int> ret(n, 0);

	vector<int> scc;
	scc = strongly_connected_components(graph);

	rep(i, n) {
		if (scc[2 * i] == scc[2 * i + 1])
			ret[0] = -1;
		else
			ret[i] = (scc[2 * i] < scc[2 * i + 1]);
	}
	return ret;
}


int val_idx[limit], idx_val[limit];

void helper(G &graph, int a, int b) {
	const int aidx = val_idx[a];
	const int bidx = val_idx[b];
	closure_or(graph, aidx ^ 1, bidx ^ 1);
	// !a | !b
}

int main(void){
	int n, x, a, o;
	cin >> n >> x >> a >> o;
	const int all = (1 << (n + 1));
	
	vector<int> order(all, 0);
	iota(begin(order), end(order), 0);

	if (x == 0) {
		puts("No");
		return 0;
	}

	int idx = 0;
	rep(i, all) {
		if(i < (i^x)) {
			idx_val[idx] = i;
			val_idx[i] = idx++;
			idx_val[idx] = i ^ x;
			val_idx[i ^ x] = idx++;
		}
	}

	G graph(all);

	rep(i, all) {
		if((i & a) != a) continue;
		int mask = i ^ (all -1);
		for(int sj = mask; ; sj = (sj - 1) & mask){
			const int j = sj | a;
 			helper(graph, i, j);
			if(sj == 0) break;
		}
	}

	rep(i, all) {
		if((i | o) != o) continue;
		int mask = i;
		for(int sj = mask; ; sj = (sj -1) & mask){
			const int j = sj | (i ^ o);
			helper(graph, i, j);
			if(sj == 0) break;
		}
	}


	auto var = get_variable(graph);



	if(var[0] != -1) {
		puts("Yes");
		rep(i, 1 << n) {
			const int tf = var[i];
	 		cout << (i?" ":"") << idx_val[2 * i + tf];
	 	}
		cout << endl;
	} else {
		puts("No");
	}


	return 0;
}


Measured memory_bytes: 248624