Problem: 2^N players competed in a tournament. Each player has a unique ID number from 1 through 2^N. When two players play a match, the player with the smaller ID always wins.

This tournament was a little special, in which losers are not eliminated to fully rank all the players.

We will call such a tournament that involves 2^n players a full tournament of level n. In a full tournament of level n, the players are ranked as follows:

* In a full tournament of level 0, the only player is ranked first.
* In a full tournament of level n\ (1 \leq n), initially all 2^n players are lined up in a row. Then:
* First, starting from the two leftmost players, the players are successively divided into 2^{n-1} pairs of two players.
* Each of the pairs plays a match. The winner enters the "Won" group, and the loser enters the "Lost" group.
* The players in the "Won" group are lined up in a row, maintaining the relative order in the previous row. Then, a full tournament of level n-1 is held to fully rank these players.
* The players in the "Lost" group are also ranked in the same manner, then the rank of each of these players increases by 2^{n-1}.



For example, the figure below shows how a full tournament of level 3 progresses when eight players are lined up in the order 3,4,8,6,2,1,7,5. The list of the players sorted by the final ranking will be 1,3,5,6,2,4,7,8.

<image>

Takahashi has a sheet of paper with the list of the players sorted by the final ranking in the tournament, but some of it blurred and became unreadable. You are given the information on the sheet as a sequence A of length N. When A_i is 1 or greater, it means that the i-th ranked player had the ID A_i. If A_i is 0, it means that the ID of the i-th ranked player is lost.

Determine whether there exists a valid order in the first phase of the tournament which is consistent with the sheet. If it exists, provide one such order.

Constraints

* 1 \leq N \leq 18
* 0 \leq A_i \leq 2^N
* No integer, except 0, occurs more than once in A_i.

Input

Input is given from Standard Input in the following format:


N
A_1 A_2 ... A_{2^N}


Output

If there exists a valid order in the first phase of the tournament, print `YES` first, then in the subsequent line, print the IDs of the players sorted by the final ranking, with spaces in between. If there is no such order, print `NO` instead.

Examples

Input

3
0 3 0 6 0 0 0 8


Output

YES
3 4 8 6 2 1 7 5


Input

1
2 1


Output

NO

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 1<<18|3;
int n,all,a[N],l[N],r[N],id[N];bool vis[N];
void GG(){puts("NO");exit(0);}
bool cmp(int x, int y){return l[x]<l[y];}
priority_queue<Pii,vector<Pii>,greater<Pii> >heap;
int main() {
	read(n);all=(1<<n)-1;
	rep(i,0,all){
		read(a[i]),a[i]--;
		if(a[i]>=0)l[i]=r[i]=a[i];
		else l[i]=0,r[i]=all;
	}
	rep(s,0,all)rep(i,0,n-1)if(!(s>>i&1))umax(l[s^(1<<i)],l[s]+1);
	per(s,all,0)rep(i,0,n-1)if(s>>i&1)umin(r[s^(1<<i)],r[s]-1);
	rep(s,0,all)if(l[s]>r[s])GG();
	rep(s,0,all)id[s]=s;sort(id,id+all+1,cmp);
//	rep(s,0,all)printf("%d:%d %d\n",s,l[s],r[s]);
	for(int s=0,p=-1;s<=all;s++){
		while(p+1<=all&&l[id[p+1]]<=s)p++,heap.push(Pii(r[id[p]],id[p]));
	//	while(!heap.empty()&&vis[heap.top().se])heap.pop();
		if(heap.empty())GG();int u=heap.top().se;heap.pop();
		if(s<l[u]||s>r[u])GG();a[u]=s;//vis[u]=1;
	}
//	rep(s,0,all)printf("%d:%d %d %d\n",s,l[s],r[s],a[s]);
	for(int i=1,j=0;i<=all;i++){
		for(int k=1<<(n-1);!((j^=k)&k);k>>=1);
	//	printf("%d %d\n",i,j);
		if(i<j)swap(a[i],a[j]);
	}
	printf("YES\n");rep(i,0,all)printf("%d ",1+a[i]);
	return 0;
}