#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

struct SCC {
    int N;
    vector<vector<int> > g, gr, g2i, t;
    vector<bool> visited;
    vector<int> i2g;
    stack<int> order;

    SCC(){}
    SCC(int n){init(n);}
    void init(int n){
        N = n;
        g.clear();
        g.resize(n);
        gr.clear();
        gr.resize(n);
        visited.resize(n);
        i2g.resize(n);
    }
    void add_edge(int u, int v) {
        g[u].emplace_back(v);
        gr[v].emplace_back(u);
    }

    void dfs(int x) {
        if (visited[x]) return;
        visited[x] = true;
        for (int i : g[x]) dfs(i);
        order.push(x);
    }

    void rdfs(int x, int k) {
        if (i2g[x] != -1) return;
        i2g[x] = k;
        for (int i : gr[x]) rdfs(i, k);
    }

    void build() {
        fill(visited.begin(), visited.end(), false);
        fill(i2g.begin(), i2g.end(), -1);
        for (int i = 0; i < N; i++) dfs(i);
        int p = 0;
        while (!order.empty()) {
            rdfs(order.top(), p++);
            order.pop();
        }
        g2i.clear();
        g2i.resize(p);
        for(int i=0;i<N;i++){
            g2i[i2g[i]].push_back(i);
        }
        t.resize(p);
        for(int i=0;i<N;i++){
            for (auto &to : g[i]) {
                int x = i2g[i], y = i2g[to];
                if (x == y) continue;
                t[x].push_back(y);
            }
        }
        for(int i=0;i<p;i++){
            sort(t[i].begin(), t[i].end());
            t[i].erase(unique(t[i].begin(), t[i].end()),t[i].end());
        }
    }
};

struct TwoSAT {
    int N;
    SCC scc;
    vector<int> ls;
    TwoSAT(){}
    TwoSAT(int n):N(n),scc(n*2){}
    int neg(int a){return (a+N)%(N*2);}
    void add_edge(int a, int b){
        scc.add_edge(a,b);
    }
    void add_if(int a, int b){
        // a -> b <=> !b -> !a
        add_edge(a,b);
        add_edge(neg(b),neg(a));
    }
    void add_iff(int a, int b){
        // (a <=> b) <=> a -> b and b -> a
        add_edge(a,b);
        add_edge(b,a);
    }
    void add_or(int a, int b){
        // a or b <=> !a -> b and !b -> a
        add_if(neg(a),b);
    }
    void add_nand(int a, int b){
        // a nand b <=> a -> !b and b -> !a
        add_if(a, neg(b));
    }
    void set_true(int a){
        // a <=> !a -> a
        add_edge(neg(a), a);
    }
    void set_false(int a){
        // !a <=> a -> !a
        add_edge(a, neg(a));
    }
    bool build(){
        scc.build();
        bool ok = true;
        for(int i=0;i<N;i++){
            ok &= scc.i2g[i] != scc.i2g[neg(i)];
        }
        if(ok){
            for(int i=0;i<N;i++){
                if(scc.i2g[i] > scc.i2g[neg(i)]){
                    ls.push_back(1);
                }
                else{
                    ls.push_back(0);
                }
            }
        }
        return ok;
    }
};

int main(){
    int N, X, A, O;
    cin >> N >> X >> A >> O;
    if(X == 0){
        cout << "No" << endl;
        return 0;
    }
    TwoSAT ts(1<<(N+1));
    for(int i=0;i<(1<<(N+1));i++){
        ts.add_nand(i,i^X);
        ts.add_or(i,i^X);
    }
    for(int i=0;i<(1<<(N+1));i++){
        if((i&A) == A){
            int j = i^((1<<(N+1))-1), k = j;
            while(1){
                ts.add_nand(i, k|A);
                if(k==0) break;
                k = (k-1)&j;
            }
        }
    }
    for(int i=0;i<(1<<(N+1));i++){
        if((i|O) == O){
            int j = i, k = j;
            while(1){
                ts.add_nand(i,k^((1<<(N+1))-1)&O);
                if(k==0) break;
                k = (k-1)&j;
            }
        }
    }
    if(ts.build()){
        cout << "Yes" << endl;
        vector<int> ans;
        for(int i=0;i<(1<<(N+1));i++){
            if(ts.ls[i]) ans.push_back(i);
        }
        for(int i=0;i<(1<<N);i++){
            cout << ans[i] << " \n"[i==(1<<N)-1];
        }
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 268544