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<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<set>
typedef int ll;
typedef unsigned un;
typedef std::string str;
typedef std::pair<ll,ll> pll;
ll read(){ll x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}return f*x;}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
void umax(ll& a,ll t){if(t>a)a=t;}
void umin(ll& a,ll t){if(t<a)a=t;}
const ll INF=1ll<<28;
#define MAXN 200011
std::vector<ll>g[MAXN];
ll dfn[MAXN],low[MAXN],scnt=0,scc[MAXN],cur=0;
ll s[MAXN],top=0;
bool ins[MAXN];
void tarjan(ll u)
{
	s[++top]=u,ins[u]=1;
	dfn[u]=low[u]=++cur;
	for(auto v:g[u])
	{
		if(!dfn[v])tarjan(v),umin(low[u],low[v]);
		else if(ins[v])umin(low[u],dfn[v]);
	}
	if(dfn[u]==low[u])
	{
		++scnt;
		while(s[top]!=u)scc[s[top]]=scnt,ins[s[top--]]=0;
		scc[s[top]]=scnt,ins[s[top--]]=0;
	}
}
ll all;
int main()
{
	ll n=read(),Xor=read(),And=read(),Or=read();
	all=(1<<(n+1))-1;
	for(ll s=0;s<=all;++s)
	{
		if((And&s)==And)
			for(ll t=all^s;;t=(t-1)&(all^s))
			{
				ll p=And|t;
				g[p].push_back(s^Xor);
				g[s].push_back(p^Xor);
				if(!t)break;
			}
		if((Or&s)==s)
			for(ll t=s;;t=(t-1)&s)
			{
				ll p=(Or^s)|t;
				g[p].push_back(s^Xor);
				g[s].push_back(p^Xor);
				if(!t)break;
			}
	}
	for(ll s=0;s<=all;++s)
		if(!dfn[s])tarjan(s);
	ll c=0;
	std::vector<ll>ans;
	for(ll s=0;s<=all;++s)
	{
		if(scc[s]==scc[s^Xor])return puts("No"),0;
		else if(c<(1<<n)&&scc[s]<scc[s^Xor])ans.push_back(s),++c;
	}
		
	puts("Yes");
	for(ll i=0;i<ans.size();++i)
	{
		if(i)putchar(' ');
		printf("%d",ans[i]);
	}
	puts("");
	return 0;
}