Problem: D: XORANDORBAN

Problem Statement

You are given a positive integer N. Your task is to determine a set S of 2^N integers satisfying the following conditions:

* All the integers in S are at least 0  and less than 2^{N+1}.
* All the integers in S are distinct.
* You are also given three integers X, A, and O, where 0 \leq X, A, O < 2^{N+1}. Then, any two integers (a, b) in S must satisfy a {\it xor} b \neq X, a {\it and} b \neq A, a {\it or} b \neq O, where {\it xor}, {\it and}, {\it or} are bitwise xor, bitwise and, bitwise or, respectively. Note that a and b are not necessarily different.



Input


N X A O

Constraints

* 1 \leq N \leq 13
* 0 \leq X, A, O < 2^{N+1}
* Inputs consist only of integers.



Output

If there is no set satisfying the conditions mentioned in the problem statement, output `No` in a line. Otherwise, output `Yes` in the first line, and then output 2^N integers in such a set in the second line. If there are multiple sets satisfying the conditions, you can output any of them.

Sample Input 1


2 6 1 5

Output for Sample Input 1


Yes
0 3 4 7


Sample Input 2


3 0 5 1

Output for Sample Input 2


No

Sample Input 3


3 4 2 5

Output for Sample Input 3


Yes
1 0 6 15 8 9 14 7






Example

Input

2 6 1 5


Output

Yes
0 3 4 7

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<int,int> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<int>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 123456789012

#define MAX_V 202020

int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];

void  addedge(int from,int to){
    G[from].push_back(to);
    rG[to].push_back(from);
}
 
void dfs(int v){
    used[v]=true;
    for(int i=0;i<G[v].size();i++){
        if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
}
 
void rdfs(int v,int k){
    used[v]=true;
    cmp[v]=k;
    for(int i=0;i<rG[v].size();i++){
        if(!used[rG[v][i]]) rdfs(rG[v][i],k);
    }
}
 
int scc(){
    memset(used,0,sizeof(used));
    vs.clear();
    for(int v=0;v<V;v++){
        if(!used[v]) dfs(v);
    }
    memset(used,0,sizeof(used));
    int k=0;
    for(int i=vs.size()-1;i>=0;i--){
        if(!used[vs[i]]) rdfs(vs[i],k++);
    }
    return k;
}

int m;

void yaj(int i,int j){
    addedge(i,j);
    addedge((j+m)%V,(i+m)%V);
}



int main(){
    int i,j;
    int n,x,a,o;
    cin>>n>>x>>a>>o;
    m=1<<(n+1);
    V=2*m;

    for(i=0;i<m;i++){
        for(j=i;j<m;j++){
            if(((i^j)==x)||((i&j)==a)||((i|j)==o)){
                yaj(i,j+m);
                yaj(j,i+m);
                //cout<<i<<" "<<j<<endl;
            }
        }
    }
    for(i=0;i<m;i++){
        j=i^x;
        yaj(i+m,j);
    }

    scc();

    vector<int> ans;
    for(i=0;i<m;i++){
        if(cmp[i]==cmp[i+m]) {
            cout<<"No"<<endl;
            return 0;
        }
        else if(cmp[i]>cmp[i+m]){
            ans.pb(i);
            //cout<<i<<endl;
        }
    }

    cout<<"Yes"<<endl;
    for(i=0;i<ans.size();i++){
        if(i!=0) cout<<" ";
        cout<<ans[i];
    }
    cout<<endl;

    return 0;
}